From 4290d0a65d9a7638076d32952952b2a2c91301ab Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 25 Oct 2017 11:59:29 +0200 Subject: [PATCH] Fix some erroneous use of LOCATION_NULL Found by @janisozaur and introduced in PR #6461. --- src/openrct2-ui/windows/Map.cpp | 4 ++-- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2/actions/RideCreateAction.hpp | 2 +- src/openrct2/peep/Staff.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 017c9f2802..093ee54322 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1290,7 +1290,7 @@ static void window_map_set_peep_spawn_tool_update(sint32 x, sint32 y) gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; footpath_bridge_get_info_from_pos(x, y, &mapX, &mapY, &direction, &mapElement); - if ((mapX & 0xFFFF) == LOCATION_NULL) + if ((mapX & 0xFFFF) == 0x8000) return; mapZ = mapElement->base_height * 8; @@ -1351,7 +1351,7 @@ static void window_map_set_peep_spawn_tool_down(sint32 x, sint32 y) sint32 mapX, mapY, mapZ, direction; footpath_get_coordinates_from_pos(x, y, &mapX, &mapY, &direction, &mapElement); - if (mapX == LOCATION_NULL) + if (mapX == 0x8000) return; surfaceMapElement = map_get_surface_element_at(mapX >> 5, mapY >> 5); diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index cdbd4323be..f2b7c90d3c 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -338,7 +338,7 @@ static void window_staff_list_tooldown(rct_window *w, rct_widgetindex widgetInde sint32 direction; rct_map_element *mapElement; footpath_get_coordinates_from_pos(x, y, &x, &y, &direction, &mapElement); - if (x == LOCATION_NULL) + if (x == 0x8000) return; bool isPatrolAreaSet = staff_is_patrol_area_set(200 + selectedPeepType, x, y); diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index f0a4e754be..b7e9308932 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -304,7 +304,7 @@ public: window_invalidate_by_class(WC_RIDE_LIST); res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION; - res->Position.x = LOCATION_NULL; + res->Position.x = 0x8000; return std::move(res); } diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 4c702f5362..dc927113f6 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -572,7 +572,7 @@ uint16 hire_new_staff_member(uint8 staffType) sint32 command_x, ebx, command_y, command_z, esi, new_sprite_index, ebp; command_y = command_z = esi = new_sprite_index = ebp = 0; - command_x = LOCATION_NULL; + command_x = 0x8000; sint32 autoposition = gConfigGeneral.auto_staff_placement; if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z)