… | |
… | |
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); |
… | |
… | |
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 | } |