--- deliantra/server/common/treasure.C 2009/10/15 16:00:37 1.87 +++ deliantra/server/common/treasure.C 2009/11/06 12:27:05 1.88 @@ -53,6 +53,21 @@ static tl_map_t tl_map; +//TODO: class method +static void +clear (treasurelist *tl) +{ + void free_treasurestruct (treasure *t); + + if (tl->items) + { + free_treasurestruct (tl->items); + tl->items = 0; + } + + tl->total_chance = 0; +} + /* * Searches for the given treasurelist */ @@ -93,19 +108,6 @@ return tl; } -//TODO: class method -void -clear (treasurelist *tl) -{ - if (tl->items) - { - free_treasurestruct (tl->items); - tl->items = 0; - } - - tl->total_chance = 0; -} - #ifdef TREASURE_DEBUG /* recursived checks the linked list. Treasurelist is passed only * so that the treasure name can be printed out @@ -775,6 +777,23 @@ return 4; } +/* special_potion() - so that old potion code is still done right. */ +int +special_potion (object *op) +{ + if (op->attacktype) + return 1; + + if (op->stats.Str || op->stats.Dex || op->stats.Con || op->stats.Pow || op->stats.Wis || op->stats.Int || op->stats.Cha) + return 1; + + for (int i = 0; i < NROFATTACKS; i++) + if (op->resist[i]) + return 1; + + return 0; +} + #define DICE2 (get_magic(2)==2?2:1) #define DICESPELL (rndm (3) + rndm (3) + rndm (3) + rndm (3) + rndm (3)) @@ -1643,23 +1662,6 @@ } } -/* special_potion() - so that old potion code is still done right. */ -int -special_potion (object *op) -{ - if (op->attacktype) - return 1; - - if (op->stats.Str || op->stats.Dex || op->stats.Con || op->stats.Pow || op->stats.Wis || op->stats.Int || op->stats.Cha) - return 1; - - for (int i = 0; i < NROFATTACKS; i++) - if (op->resist[i]) - return 1; - - return 0; -} - void free_treasurestruct (treasure *t) {