From f8aac831ca68ef42a788a37d7597b7343c420424 Mon Sep 17 00:00:00 2001 From: Daniel Trujillo Date: Sun, 17 Jul 2016 17:05:17 +0200 Subject: [PATCH] Comment map_element_remove() --- src/world/map.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/world/map.c b/src/world/map.c index 9a6152a802..1f1938d5d2 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -3803,11 +3803,16 @@ int map_get_station(rct_map_element *mapElement) */ void map_element_remove(rct_map_element *mapElement) { + // Replace Nth element by (N+1)th element. + // This loop will make mapElement point to the old last element position, + // befor copy it to it's new position if (!map_element_is_last_for_tile(mapElement)){ do{ *mapElement = *(mapElement + 1); } while (!map_element_is_last_for_tile(++mapElement)); } + + // Mark the latest element with the last element flag. (mapElement - 1)->flags |= MAP_ELEMENT_FLAG_LAST_TILE; mapElement->base_height = 0xFF;