From bb9861884786a6b60fada21fca31c7a0cefd3345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Fri, 16 Mar 2018 20:57:22 +0100 Subject: [PATCH] Fix compilation errors in Footpath.cpp --- src/openrct2/world/Footpath.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index b1836e6aad..5059c5a252 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1159,8 +1159,8 @@ static bool neighbour_list_pop(rct_neighbour_list *neighbourList, rct_neighbour return false; *outNeighbour = neighbourList->items[0]; - for (sint32 i = 0; i < neighbourList->count - 1; i++) - neighbourList->items[i] = neighbourList->items[i + 1]; + const size_t bytesToMove = (neighbourList->count - 1) * sizeof(neighbourList->items[0]); + memmove(&neighbourList->items[0], &neighbourList->items[1], bytesToMove); neighbourList->count--; return true; } @@ -1444,7 +1444,7 @@ void footpath_connect_edges(sint32 x, sint32 y, rct_tile_element *tileElement, s if (tile_element_get_type(tileElement) == TILE_ELEMENT_TYPE_PATH && footpath_element_is_queue(tileElement)) { sint32 rideIndex = -1; uint8 entranceIndex = 255; - for (sint32 i = 0; i < neighbourList.count; i++) { + for (size_t i = 0; i < neighbourList.count; i++) { if (neighbourList.items[i].ride_index != 255) { if (rideIndex == -1) { rideIndex = neighbourList.items[i].ride_index;