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.96 by root, Sun Nov 29 09:41:28 2009 UTC vs.
Revision 1.98 by root, Sun Nov 29 17:41:07 2009 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);
1144 1144
1145/* 1145/*
1146 * Allocate and return the pointer to an empty artifactlist structure. 1146 * Allocate and return the pointer to an empty artifactlist structure.
1147 */ 1147 */
1148static artifactlist * 1148static artifactlist *
1149get_empty_artifactlist (void) 1149get_empty_artifactlist ()
1150{ 1150{
1151 return salloc0<artifactlist> (); 1151 return salloc0<artifactlist> ();
1152} 1152}
1153 1153
1154/* 1154/*
1155 * Allocate and return the pointer to an empty artifact structure. 1155 * Allocate and return the pointer to an empty artifact structure.
1156 */ 1156 */
1157static artifact * 1157static artifact *
1158get_empty_artifact (void) 1158get_empty_artifact ()
1159{ 1159{
1160 return salloc0<artifact> (); 1160 return salloc0<artifact> ();
1161} 1161}
1162 1162
1163/* 1163/*
1176 1176
1177/* 1177/*
1178 * Builds up the lists of artifacts from the file in the libdir. 1178 * Builds up the lists of artifacts from the file in the libdir.
1179 */ 1179 */
1180void 1180void
1181init_artifacts (void) 1181init_artifacts ()
1182{ 1182{
1183 static int has_been_inited = 0; 1183 static int has_been_inited = 0;
1184 char filename[MAX_BUF]; 1184 char filename[MAX_BUF];
1185 artifact *art = NULL; 1185 artifact *art = NULL;
1186 artifactlist *al; 1186 artifactlist *al;
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