--- deliantra/server/random_maps/treasure.C 2008/05/08 13:47:19 1.40 +++ deliantra/server/random_maps/treasure.C 2008/09/29 10:32:50 1.44 @@ -54,14 +54,8 @@ gen_key (const shstr &keycode) { /* get a key and set its keycode */ - object *key = archetype::get (shstr_key2); - + object *key = archetype::get (shstr_key_random_map); key->slaying = keycode; - key->stats.food = 100; - key->speed_left = -1.f; - key->flag [FLAG_IS_USED_UP] = true; - key->set_speed (1.f / 300.f); - return key; } @@ -677,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; - 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; - }; + if (tmp->flag [FLAG_ALIVE]) + tmp->head_ ()->destroy (); + + tmp = next; + } } /* surrounds the point x,y by doors, so as to enclose something, like @@ -828,15 +818,14 @@ 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 ("locked_door1"); + object *new_door = get_archetype (shstr_locked_door1); door = doorlist[i]; new_door->face = door->face; new_door->x = door->x; new_door->y = door->y; - door->remove (); door->destroy (); doorlist[i] = new_door; insert_ob_in_map (new_door, map, NULL, 0); @@ -863,9 +852,6 @@ door->face = wallface->face; - if (!QUERY_FLAG (wallface, FLAG_REMOVED)) - wallface->remove (); - wallface->destroy (); } }