ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/treasure.C
(Generate patch)

Comparing deliantra/server/common/treasure.C (file contents):
Revision 1.97 by root, Sun Nov 29 10:55:18 2009 UTC vs.
Revision 1.99 by root, Tue Jan 5 12:01:43 2010 UTC

310 } 310 }
311 else 311 else
312 { 312 {
313 if (t->item && (t->item->invisible != 0 || !(flag & GT_INVISIBLE))) 313 if (t->item && (t->item->invisible != 0 || !(flag & GT_INVISIBLE)))
314 { 314 {
315 object *tmp = arch_to_object (t->item); 315 object *tmp = t->item->instance ();
316 316
317 if (t->nrof && tmp->nrof <= 1) 317 if (t->nrof && tmp->nrof <= 1)
318 tmp->nrof = rndm (t->nrof) + 1; 318 tmp->nrof = rndm (t->nrof) + 1;
319 319
320 fix_generated_item (tmp, op, difficulty, t->magic, flag); 320 fix_generated_item (tmp, op, difficulty, t->magic, flag);
367 else if (t->nrof) 367 else if (t->nrof)
368 create_one_treasure (tl, op, flag, difficulty, tries); 368 create_one_treasure (tl, op, flag, difficulty, tries);
369 } 369 }
370 else if (t->item && (t->item->invisible != 0 || flag != GT_INVISIBLE)) 370 else if (t->item && (t->item->invisible != 0 || flag != GT_INVISIBLE))
371 { 371 {
372 if (object *tmp = arch_to_object (t->item)) 372 if (object *tmp = t->item->instance ())
373 { 373 {
374 if (t->nrof && tmp->nrof <= 1) 374 if (t->nrof && tmp->nrof <= 1)
375 tmp->nrof = rndm (t->nrof) + 1; 375 tmp->nrof = rndm (t->nrof) + 1;
376 376
377 fix_generated_item (tmp, op, difficulty, t->magic, flag); 377 fix_generated_item (tmp, op, difficulty, t->magic, flag);
1210 1210
1211 const char *cp = f.get_str (); 1211 const char *cp = f.get_str ();
1212 char *next; 1212 char *next;
1213 do 1213 do
1214 { 1214 {
1215 if ((next = strchr (cp, ','))) 1215 if ((next = (char *)strchr (cp, ',')))
1216 *next++ = '\0'; 1216 *next++ = '\0';
1217 1217
1218 linked_char *tmp = new linked_char; 1218 linked_char *tmp = new linked_char;
1219 1219
1220 tmp->name = cp; 1220 tmp->name = cp;
1367 if (op->type == HORN || op->type == POTION) 1367 if (op->type == HORN || op->type == POTION)
1368 { 1368 {
1369 /* Remove any spells this object currently has in it */ 1369 /* Remove any spells this object currently has in it */
1370 op->destroy_inv (false); 1370 op->destroy_inv (false);
1371 1371
1372 object *tmp = arch_to_object (change->other_arch); 1372 object *tmp = change->other_arch->instance ();
1373 insert_ob_in_ob (tmp, op); 1373 insert_ob_in_ob (tmp, op);
1374 } 1374 }
1375 /* No harm setting this for potions/horns */ 1375 /* No harm setting this for potions/horns */
1376 op->other_arch = change->other_arch; 1376 op->other_arch = change->other_arch;
1377 } 1377 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines