… | |
… | |
600 | } \ |
600 | } \ |
601 | } |
601 | } |
602 | |
602 | |
603 | extern dynbuf mapwalk_buf; // can be used in simple non-recursive situations |
603 | extern dynbuf mapwalk_buf; // can be used in simple non-recursive situations |
604 | |
604 | |
|
|
605 | // special "grave" map used to store all removed objects |
|
|
606 | // till they can be destroyed - saves a lot of checks in the rest |
|
|
607 | // of the code |
|
|
608 | struct freed_map |
|
|
609 | : maptile |
|
|
610 | { |
|
|
611 | freed_map () |
|
|
612 | : maptile (3, 3) |
|
|
613 | { |
|
|
614 | path = "<freed objects map>"; |
|
|
615 | name = "/internal/freed_objects_map"; |
|
|
616 | no_drop = 1; |
|
|
617 | no_reset = 1; |
|
|
618 | |
|
|
619 | state = MAP_ACTIVE; |
|
|
620 | } |
|
|
621 | |
|
|
622 | ~freed_map () |
|
|
623 | { |
|
|
624 | destroy (); |
|
|
625 | } |
|
|
626 | }; |
|
|
627 | |
|
|
628 | // initialised in common/shstr.C, due to shstr usage we need defined |
|
|
629 | // initialisation order! |
|
|
630 | extern struct freed_map freed_map; // freed objects are moved here to avoid crashes |
|
|
631 | |
605 | // loop over every space in the given maprect, |
632 | // loop over every space in the given maprect, |
606 | // setting m, nx, ny to the map and -coordinate and dx, dy to the offset relative to dx0,dy0 |
633 | // setting m, nx, ny to the map and -coordinate and dx, dy to the offset relative to dx0,dy0 |
607 | // the iterator code must be a single statement following this macro call, similar to "if" |
634 | // the iterator code must be a single statement following this macro call, similar to "if" |
608 | // "continue" will skip to the next space |
635 | // "continue" will skip to the next space |
609 | #define rect_mapwalk(rect,dx0,dy0) \ |
636 | #define rect_mapwalk(rect,dx0,dy0) \ |