… | |
… | |
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 | /* |
… | |
… | |
849 | } |
849 | } |
850 | |
850 | |
851 | if (difficulty < 1) |
851 | if (difficulty < 1) |
852 | difficulty = 1; |
852 | difficulty = 1; |
853 | |
853 | |
|
|
854 | if (INVOKE_OBJECT (ADD_BONUS, op, |
|
|
855 | ARG_OBJECT (creator != op ? creator : 0), |
|
|
856 | ARG_INT (difficulty), ARG_INT (max_magic), |
|
|
857 | ARG_INT (flags))) |
|
|
858 | return; |
|
|
859 | |
854 | if (!(flags & GT_MINIMAL)) |
860 | if (!(flags & GT_MINIMAL)) |
855 | { |
861 | { |
856 | if (op->arch == crown_arch) |
862 | if (op->arch == crown_arch) |
857 | { |
863 | { |
858 | set_magic (difficulty, op, max_magic, flags); |
864 | set_magic (difficulty, op, max_magic, flags); |
… | |
… | |
1845 | free_artifact (at->next); |
1851 | free_artifact (at->next); |
1846 | |
1852 | |
1847 | if (at->allowed) |
1853 | if (at->allowed) |
1848 | free_charlinks (at->allowed); |
1854 | free_charlinks (at->allowed); |
1849 | |
1855 | |
1850 | at->item->free (1); |
1856 | at->item->destroy (1); |
1851 | |
1857 | |
1852 | delete at; |
1858 | delete at; |
1853 | } |
1859 | } |
1854 | |
1860 | |
1855 | void |
1861 | void |
1856 | free_artifactlist (artifactlist * al) |
1862 | free_artifactlist (artifactlist * al) |
1857 | { |
1863 | { |
1858 | artifactlist *nextal; |
1864 | artifactlist *nextal; |
1859 | |
1865 | |
1860 | for (al = first_artifactlist; al != NULL; al = nextal) |
1866 | for (al = first_artifactlist; al; al = nextal) |
1861 | { |
1867 | { |
1862 | nextal = al->next; |
1868 | nextal = al->next; |
1863 | |
1869 | |
1864 | if (al->items) |
1870 | if (al->items) |
1865 | free_artifact (al->items); |
1871 | free_artifact (al->items); |