From 96ff8fe7a1100c714791420ecefb8f05f7eb52af Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 22 Dec 2019 13:03:32 +0000 Subject: [PATCH] Change value of COORDS_NULL to a less likely to collide value. (#10423) It will also now match LOCATION_NULL. As this change should only affect in memory coords there should be no save, replay, network issues. --- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/Station.cpp | 2 +- src/openrct2/world/Location.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 4e3954b7d7..48dc1a2c25 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -4282,7 +4282,7 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) *position++ = exit; } } - (*position++).x = COORDS_NULL; + (*position++).setNull(); // Enumerate entrance and exit positions for (position = positions; !(*position).isNull(); position++) diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 7074be8920..0e0e2f89a4 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -373,7 +373,7 @@ int8_t ride_get_first_valid_station_exit(Ride* ride) { for (int32_t i = 0; i < MAX_STATIONS; i++) { - if (ride->stations[i].Exit.x != COORDS_NULL) + if (!ride->stations[i].Exit.isNull()) { return i; } diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 56bc729951..65f544dcab 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -59,7 +59,7 @@ struct LocationXYZ16 assert_struct_size(LocationXYZ16, 6); #pragma pack(pop) -constexpr int32_t COORDS_NULL = -1; +constexpr int32_t COORDS_NULL = 0xFFFF8000; struct ScreenCoordsXY {