… | |
… | |
441 | goto fail; |
441 | goto fail; |
442 | } |
442 | } |
443 | } |
443 | } |
444 | |
444 | |
445 | // assemble new chain |
445 | // assemble new chain |
446 | new_head->min_x = new_head->max_x = new_head->x; |
446 | new_head->max_x = new_head->x; |
447 | new_head->min_y = new_head->max_y = new_head->y; |
|
|
448 | |
447 | |
449 | archetype *less = new_head; |
448 | archetype *less = new_head; |
450 | for (auto (p, parts.begin () + 1); p != parts.end (); ++p) |
449 | for (auto (p, parts.begin () + 1); p != parts.end (); ++p) |
451 | { |
450 | { |
452 | archetype *at = *p; |
451 | archetype *at = *p; |
… | |
… | |
457 | at->flag [FLAG_ALIVE] = new_head->flag [FLAG_ALIVE]; |
456 | at->flag [FLAG_ALIVE] = new_head->flag [FLAG_ALIVE]; |
458 | at->flag [FLAG_NO_PICK] = new_head->flag [FLAG_NO_PICK]; |
457 | at->flag [FLAG_NO_PICK] = new_head->flag [FLAG_NO_PICK]; |
459 | at->flag [FLAG_MONSTER] = new_head->flag [FLAG_MONSTER]; |
458 | at->flag [FLAG_MONSTER] = new_head->flag [FLAG_MONSTER]; |
460 | at->flag [FLAG_IS_FLOOR] = new_head->flag [FLAG_IS_FLOOR]; |
459 | at->flag [FLAG_IS_FLOOR] = new_head->flag [FLAG_IS_FLOOR]; |
461 | |
460 | |
462 | new_head->min_x = min (new_head->min_x, at->x); |
|
|
463 | new_head->min_y = min (new_head->min_y, at->y); |
|
|
464 | new_head->max_x = max (new_head->max_x, at->x); |
461 | new_head->max_x = max (new_head->max_x, at->x); |
465 | new_head->max_y = max (new_head->max_y, at->y); |
|
|
466 | |
462 | |
467 | at->head = new_head; |
463 | at->head = new_head; |
468 | less->more = at; |
464 | less->more = at; |
469 | less = at; |
465 | less = at; |
470 | } |
466 | } |