… | |
… | |
789 | { |
789 | { |
790 | /* Only if the space blocks everything do we not process - |
790 | /* Only if the space blocks everything do we not process - |
791 | * if some form of movement is allowed, let objects |
791 | * if some form of movement is allowed, let objects |
792 | * drop on that space. |
792 | * drop on that space. |
793 | */ |
793 | */ |
794 | if (!drop_to_ground || !map || map->in_memory != MAP_IN_MEMORY || GET_MAP_MOVE_BLOCK (map, x, y) == MOVE_ALL) |
794 | if (!drop_to_ground |
|
|
795 | || !map |
|
|
796 | || map->in_memory != MAP_IN_MEMORY |
|
|
797 | || map->at (x, y).move_block == MOVE_ALL) |
795 | { |
798 | { |
796 | while (inv) |
799 | while (inv) |
|
|
800 | { |
|
|
801 | inv->destroy_inv (drop_to_ground); |
797 | inv->destroy (); |
802 | inv->destroy (); |
|
|
803 | } |
798 | } |
804 | } |
799 | else |
805 | else |
800 | { /* Put objects in inventory onto this space */ |
806 | { /* Put objects in inventory onto this space */ |
801 | while (inv) |
807 | while (inv) |
802 | { |
808 | { |
… | |
… | |
827 | } |
833 | } |
828 | |
834 | |
829 | void |
835 | void |
830 | object::do_destroy () |
836 | object::do_destroy () |
831 | { |
837 | { |
832 | attachable::do_destroy (); |
|
|
833 | |
|
|
834 | if (flag [FLAG_IS_LINKED]) |
838 | if (flag [FLAG_IS_LINKED]) |
835 | remove_button_link (this); |
839 | remove_button_link (this); |
836 | |
840 | |
837 | if (flag [FLAG_FRIENDLY]) |
841 | if (flag [FLAG_FRIENDLY]) |
838 | remove_friendly_object (this); |
842 | remove_friendly_object (this); |
… | |
… | |
841 | remove (); |
845 | remove (); |
842 | |
846 | |
843 | if (flag [FLAG_FREED]) |
847 | if (flag [FLAG_FREED]) |
844 | return; |
848 | return; |
845 | |
849 | |
|
|
850 | set_speed (0); |
|
|
851 | |
846 | flag [FLAG_FREED] = 1; |
852 | flag [FLAG_FREED] = 1; |
847 | |
853 | |
|
|
854 | attachable::do_destroy (); |
|
|
855 | |
848 | destroy_inv (true); |
856 | destroy_inv (true); |
849 | set_speed (0); |
|
|
850 | unlink (); |
857 | unlink (); |
851 | |
858 | |
852 | // hack to ensure that freed objects still have a valid map |
859 | // hack to ensure that freed objects still have a valid map |
853 | { |
860 | { |
854 | static maptile *freed_map; // freed objects are moved here to avoid crashes |
861 | static maptile *freed_map; // freed objects are moved here to avoid crashes |
… | |
… | |
1014 | if (map->in_memory == MAP_SAVING) |
1021 | if (map->in_memory == MAP_SAVING) |
1015 | return; |
1022 | return; |
1016 | |
1023 | |
1017 | int check_walk_off = !flag [FLAG_NO_APPLY]; |
1024 | int check_walk_off = !flag [FLAG_NO_APPLY]; |
1018 | |
1025 | |
1019 | for (tmp = GET_MAP_OB (map, x, y); tmp; tmp = tmp->above) |
1026 | for (tmp = map->at (x, y).bot; tmp; tmp = tmp->above) |
1020 | { |
1027 | { |
1021 | /* No point updating the players look faces if he is the object |
1028 | /* No point updating the players look faces if he is the object |
1022 | * being removed. |
1029 | * being removed. |
1023 | */ |
1030 | */ |
1024 | |
1031 | |