--- deliantra/server/common/recipe.C 2006/12/12 21:39:56 1.9 +++ deliantra/server/common/recipe.C 2006/12/14 22:45:40 1.11 @@ -18,9 +18,10 @@ * arch potion_generic */ +#include + #include #include -#include static void build_stringlist (const char *str, char ***result_list, size_t * result_size); @@ -356,36 +357,44 @@ archetype *at; if (depth > 10) - return NULL; - while (t != NULL) + return 0; + + while (t) { - if (t->name != NULL) + if (t->name) { tl = find_treasurelist (t->name); - at = find_treasure_by_name (tl->items, name, depth + 1); - if (at != NULL) - return at; + + if (tl) + { + at = find_treasure_by_name (tl->items, name, depth + 1); + + if (at) + return at; + } } else { if (!strcasecmp (t->item->clone.name, name)) return t->item; } - if (t->next_yes != NULL) + + if (t->next_yes) { at = find_treasure_by_name (t->next_yes, name, depth); - if (at != NULL) + if (at) return at; } - if (t->next_no != NULL) + + if (t->next_no) { at = find_treasure_by_name (t->next_no, name, depth); - if (at != NULL) + if (at) return at; } t = t->next; } - return NULL; + return 0; } /* If several archetypes have the same name, the value of the first @@ -469,7 +478,7 @@ if (at->clone.randomitems != NULL) { at2 = find_treasure_by_name (at->clone.randomitems->items, part2, 0); - if (at2 != NULL) + if (at2) return mult * at2->clone.value * isqrt (at->clone.level * 2); } } @@ -737,7 +746,7 @@ size_t size; size_t i; - dup = strdup_local (str); + dup = strdup (str); if (dup == NULL) fatal (OUT_OF_MEMORY);