--- deliantra/server/random_maps/treasure.C 2008/09/25 04:35:50 1.42
+++ deliantra/server/random_maps/treasure.C 2009/10/12 14:00:58 1.45
@@ -5,18 +5,19 @@
* Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Deliantra is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * Deliantra is free software: you can redistribute it and/or modify it under
+ * the terms of the Affero GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or (at your
+ * option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
+ * You should have received a copy of the Affero GNU General Public License
+ * and the GNU General Public License along with this program. If not, see
+ * .
*
* The authors can be reached via e-mail to
*/
@@ -671,19 +672,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 ();
- 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 +819,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,7 +827,6 @@
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);
@@ -857,9 +853,6 @@
door->face = wallface->face;
- if (!QUERY_FLAG (wallface, FLAG_REMOVED))
- wallface->remove ();
-
wallface->destroy ();
}
}