… | |
… | |
458 | |
458 | |
459 | /* Don't want to free the object we are about to return */ |
459 | /* Don't want to free the object we are about to return */ |
460 | tmp = ob->inv; |
460 | tmp = ob->inv; |
461 | if (tmp != NULL) |
461 | if (tmp != NULL) |
462 | remove_ob (tmp); |
462 | remove_ob (tmp); |
|
|
463 | |
463 | if (ob->inv) |
464 | if (ob->inv) |
464 | { |
|
|
465 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
465 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
466 | } |
466 | |
467 | free_object (ob); |
467 | free_object (ob); |
468 | return tmp; |
468 | return tmp; |
469 | } |
469 | } |
470 | |
470 | |
471 | /* |
471 | /* |
… | |
… | |
1556 | op->gen_sp_armour = (op->gen_sp_armour * (change->gen_sp_armour)) / 100; |
1556 | op->gen_sp_armour = (op->gen_sp_armour * (change->gen_sp_armour)) / 100; |
1557 | |
1557 | |
1558 | op->item_power = change->item_power; |
1558 | op->item_power = change->item_power; |
1559 | |
1559 | |
1560 | for (i = 0; i < NROFATTACKS; i++) |
1560 | for (i = 0; i < NROFATTACKS; i++) |
1561 | { |
|
|
1562 | if (change->resist[i]) |
1561 | if (change->resist[i]) |
1563 | { |
|
|
1564 | op->resist[i] += change->resist[i]; |
1562 | op->resist[i] += change->resist[i]; |
1565 | } |
|
|
1566 | } |
|
|
1567 | |
1563 | |
1568 | if (change->stats.dam) |
1564 | if (change->stats.dam) |
1569 | { |
1565 | { |
1570 | if (change->stats.dam < 0) |
1566 | if (change->stats.dam < 0) |
1571 | op->stats.dam = (-change->stats.dam); |
1567 | op->stats.dam = (-change->stats.dam); |
… | |
… | |
1849 | free_artifact (at->next); |
1845 | free_artifact (at->next); |
1850 | |
1846 | |
1851 | if (at->allowed) |
1847 | if (at->allowed) |
1852 | free_charlinks (at->allowed); |
1848 | free_charlinks (at->allowed); |
1853 | |
1849 | |
1854 | at->item->free (1); |
1850 | at->item->destroy (1); |
1855 | |
1851 | |
1856 | delete at; |
1852 | delete at; |
1857 | } |
1853 | } |
1858 | |
1854 | |
1859 | void |
1855 | void |
1860 | free_artifactlist (artifactlist * al) |
1856 | free_artifactlist (artifactlist * al) |
1861 | { |
1857 | { |
1862 | artifactlist *nextal; |
1858 | artifactlist *nextal; |
1863 | |
1859 | |
1864 | for (al = first_artifactlist; al != NULL; al = nextal) |
1860 | for (al = first_artifactlist; al; al = nextal) |
1865 | { |
1861 | { |
1866 | nextal = al->next; |
1862 | nextal = al->next; |
1867 | |
1863 | |
1868 | if (al->items) |
1864 | if (al->items) |
1869 | free_artifact (al->items); |
1865 | free_artifact (al->items); |