… | |
… | |
355 | { |
355 | { |
356 | if (!spaces) |
356 | if (!spaces) |
357 | return; |
357 | return; |
358 | |
358 | |
359 | for (mapspace *ms = spaces + size (); ms-- > spaces; ) |
359 | for (mapspace *ms = spaces + size (); ms-- > spaces; ) |
360 | for (object *op = ms->bot; op; op = op->above) |
360 | { |
|
|
361 | object *op = ms->bot; |
|
|
362 | while (op) |
361 | { |
363 | { |
362 | /* already multipart - don't do anything more */ |
364 | /* already multipart - don't do anything more */ |
363 | if (op->head_ () == op && !op->more && op->arch->more) |
365 | if (op->head_ () == op && !op->more && op->arch->more) |
364 | { |
366 | { |
365 | op->remove (); |
367 | op->remove (); |
366 | op->expand_tail (); |
368 | op->expand_tail (); |
|
|
369 | |
|
|
370 | // FIXME: INS_ON_TOP is just a workaround for the pentagram vs. |
|
|
371 | // multi-tile monster bug, where INS_ABOVE_FLOOR_ONLY put the monsters |
|
|
372 | // below the pentagrams... hopefully INS_ON_TOP doesn't break anything |
367 | insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ABOVE_FLOOR_ONLY | INS_NO_WALK_ON); |
373 | insert (op, op->x, op->y, 0, INS_NO_MERGE | INS_ON_TOP | INS_NO_WALK_ON); |
|
|
374 | |
|
|
375 | op = ms->bot; // we are mutating the mapspace too much with INS_ON_TOP |
|
|
376 | // so we have to reset the iteration through the mapspace |
368 | } |
377 | } |
|
|
378 | else |
|
|
379 | op = op->above; |
369 | } |
380 | } |
|
|
381 | } |
370 | } |
382 | } |
371 | |
383 | |
372 | /* |
384 | /* |
373 | * Loads (ands parses) the objects into a given map from the specified |
385 | * Loads (ands parses) the objects into a given map from the specified |
374 | * file pointer. |
386 | * file pointer. |