1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcs_treasure_c = |
3 | * static char *rcs_treasure_c = |
4 | * "$Id: treasure.C,v 1.14 2006/09/07 09:37:12 pippijn Exp $"; |
4 | * "$Id: treasure.C,v 1.15 2006/09/09 21:48:28 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
1835 | } |
1835 | } |
1836 | |
1836 | |
1837 | void |
1837 | void |
1838 | free_artifact (artifact * at) |
1838 | free_artifact (artifact * at) |
1839 | { |
1839 | { |
1840 | |
|
|
1841 | if (at->next) |
1840 | if (at->next) |
1842 | free_artifact (at->next); |
1841 | free_artifact (at->next); |
|
|
1842 | |
1843 | if (at->allowed) |
1843 | if (at->allowed) |
1844 | free_charlinks (at->allowed); |
1844 | free_charlinks (at->allowed); |
1845 | |
1845 | |
1846 | delete at->item; |
1846 | at->item->free (1); |
1847 | |
1847 | |
1848 | delete at; |
1848 | delete at; |
1849 | } |
1849 | } |
1850 | |
1850 | |
1851 | void |
1851 | void |
1852 | free_artifactlist (artifactlist * al) |
1852 | free_artifactlist (artifactlist * al) |
1853 | { |
1853 | { |
1854 | artifactlist *nextal; |
1854 | artifactlist *nextal; |
|
|
1855 | |
1855 | for (al = first_artifactlist; al != NULL; al = nextal) |
1856 | for (al = first_artifactlist; al != NULL; al = nextal) |
1856 | { |
1857 | { |
1857 | nextal = al->next; |
1858 | nextal = al->next; |
|
|
1859 | |
1858 | if (al->items) |
1860 | if (al->items) |
1859 | { |
|
|
1860 | free_artifact (al->items); |
1861 | free_artifact (al->items); |
1861 | } |
1862 | |
1862 | free (al); |
1863 | free (al); |
1863 | } |
1864 | } |
1864 | } |
1865 | } |
1865 | |
1866 | |
1866 | void |
1867 | void |