extern void free_items(struct Item * item)
{
- if (0 != item->map_obj.next)
+ if (0 == item)
{
- free_items((struct Item *) item->map_obj.next);
+ return;
}
+ free_items((struct Item *) item->map_obj.next);
free(item);
}
extern void free_monsters(struct Monster * monster)
{
- if (0 != monster->map_obj.next)
+ if (0 == monster)
{
- free_monsters((struct Monster *) monster->map_obj.next);
+ return;
}
+ free_monsters((struct Monster *) monster->map_obj.next);
free(monster);
}