From 1e3504cd36de6fec0833bc29c3aa88eca28a66ad Mon Sep 17 00:00:00 2001 From: Daniel Trujillo Viedma Date: Mon, 11 Jul 2016 00:11:04 +0200 Subject: [PATCH] Fix #1432: Sandbox mode reducing map size causes game to freeze Shift correctly direction bits when calling game_do_command. game_command_remove_large_scenery() expects the direction bits to be shifted 8 times to the left, so the call to game_do_command has been modified to match this requirement. --- src/world/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/map.c b/src/world/map.c index 954fd63ab9..682a0cb96a 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -4549,7 +4549,7 @@ static void clear_elements_at(int x, int y) gGameCommandErrorTitle = STR_CANT_REMOVE_THIS; game_do_command( x, - (GAME_COMMAND_FLAG_APPLY) | (mapElement->type & MAP_ELEMENT_DIRECTION_MASK), + (GAME_COMMAND_FLAG_APPLY) | ((mapElement->type & MAP_ELEMENT_DIRECTION_MASK) << 8), y, (mapElement->base_height) | (((mapElement->properties.scenerymultiple.type >> 8) >> 2) << 8), GAME_COMMAND_REMOVE_LARGE_SCENERY,