--- deliantra/server/random_maps/treasure.C 2008/09/25 04:35:50 1.42 +++ deliantra/server/random_maps/treasure.C 2008/09/29 09:04:51 1.43 @@ -119,7 +119,7 @@ { if (wall_blocked (map, x, y)) { - the_key->destroy (); + the_key->destroy (true); return 0; } @@ -145,7 +145,7 @@ keyplace (map, x - 1, y - 1, keycode, NO_PASS_DOORS, 1, RP); } - the_key->destroy (); + the_key->destroy (true); return 1; } } @@ -333,7 +333,7 @@ int i = find_first_free_spot (the_chest, map, x, y); // this call uses the main rng if (i == -1) { - the_chest->destroy (); + the_chest->destroy (true); return NULL; } @@ -671,19 +671,15 @@ void remove_monsters (int x, int y, maptile *map) { - object *tmp; + for (object *tmp = GET_MAP_OB (map, x, y); tmp; ) + { + object *next = tmp->above; + + if (tmp->flag [FLAG_ALIVE]) + tmp->head_ ()->destroy (true); - for (tmp = GET_MAP_OB (map, x, y); tmp; tmp = tmp->above) - if (QUERY_FLAG (tmp, FLAG_ALIVE)) - { - if (tmp->head) - tmp = tmp->head; - tmp->remove (); - tmp->destroy (); - tmp = GET_MAP_OB (map, x, y); - if (tmp == NULL) - break; - }; + tmp = next; + } } /* surrounds the point x,y by doors, so as to enclose something, like @@ -822,7 +818,7 @@ if (opts & DOORED) { - for (i = 0, door = doorlist[0]; doorlist[i] != NULL; i++) + for (i = 0, door = doorlist[0]; doorlist[i]; i++) { object *new_door = get_archetype (shstr_locked_door1); @@ -830,8 +826,7 @@ new_door->face = door->face; new_door->x = door->x; new_door->y = door->y; - door->remove (); - door->destroy (); + door->destroy (true); doorlist[i] = new_door; insert_ob_in_map (new_door, map, NULL, 0); new_door->slaying = format ("RMG-%d-%d", (int)rmg_rndm (1000000000), (int)rmg_rndm (1000000000)); @@ -857,10 +852,7 @@ door->face = wallface->face; - if (!QUERY_FLAG (wallface, FLAG_REMOVED)) - wallface->remove (); - - wallface->destroy (); + wallface->destroy (true); } } }