--- deliantra/server/common/map.C 2007/06/07 19:12:22 1.109
+++ deliantra/server/common/map.C 2007/07/13 15:54:40 1.113
@@ -1,23 +1,22 @@
/*
- * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game.
+ * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
*
* Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
* Copyright (©) 2001-2003,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT 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 2 of the License, or (at your option)
- * any later version.
+ * Crossfire TRT 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.
*
- * 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.
+ * 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 Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*
* The authors can be reached via e-mail to
*/
@@ -358,16 +357,28 @@
return;
for (mapspace *ms = spaces + size (); ms-- > spaces; )
- for (object *op = ms->bot; op; op = op->above)
- {
- /* already multipart - don't do anything more */
- if (op->head_ () == op && !op->more && op->arch->more)
- {
- op->remove ();
- op->expand_tail ();
- insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ABOVE_FLOOR_ONLY | INS_NO_WALK_ON);
- }
- }
+ {
+ object *op = ms->bot;
+ while (op)
+ {
+ /* already multipart - don't do anything more */
+ if (op->head_ () == op && !op->more && op->arch->more)
+ {
+ op->remove ();
+ op->expand_tail ();
+
+ // FIXME: INS_ON_TOP is just a workaround for the pentagram vs.
+ // multi-tile monster bug, where INS_ABOVE_FLOOR_ONLY put the monsters
+ // below the pentagrams... hopefully INS_ON_TOP doesn't break anything
+ insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ON_TOP | INS_NO_WALK_ON);
+
+ op = ms->bot; // we are mutating the mapspace too much with INS_ON_TOP
+ // so we have to reset the iteration through the mapspace
+ }
+ else
+ op = op->above;
+ }
+ }
}
/*
@@ -737,6 +748,10 @@
case KW_tile_path_3: thawer.get (tile_path [2]); break;
case KW_tile_path_4: thawer.get (tile_path [3]); break;
+ case KW_ERROR:
+ set_key (thawer.kw_str, thawer.value);
+ break;
+
case KW_end:
return true;
@@ -867,8 +882,8 @@
void
maptile::clear ()
{
- sfree (regions, size ()), regions = 0;
- free (regionmap), regionmap = 0;
+ sfree (regions, size ()); regions = 0;
+ delete [] regionmap; regionmap = 0;
if (spaces)
{