--- deliantra/server/common/map.C 2007/07/01 05:00:17 1.110 +++ deliantra/server/common/map.C 2007/07/12 18:28:09 1.111 @@ -357,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; + } + } } /*