--- deliantra/server/random_maps/treasure.C 2008/05/08 13:47:19 1.40
+++ 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
*/
@@ -54,14 +55,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 +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;
- 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 +819,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 +853,6 @@
door->face = wallface->face;
- if (!QUERY_FLAG (wallface, FLAG_REMOVED))
- wallface->remove ();
-
wallface->destroy ();
}
}