From 22750a95e44e8366e17c1b541d8282eb45d85091 Mon Sep 17 00:00:00 2001 From: ZehMatt Date: Wed, 19 Jul 2017 22:48:46 +0200 Subject: [PATCH] Fix using rct_xy8 incorrect. --- src/openrct2/actions/RideCreateAction.hpp | 8 ++++---- src/openrct2/actions/RideSetStatus.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index 34ffa32163..b39f683d2d 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -131,7 +131,7 @@ public: ride->type = rideType; ride->subtype = rideEntryIndex; ride_set_colour_preset(ride, res.RideColor() & 0xFF); - ride->overall_view = 0xFFFF; + ride->overall_view.xy = RCT_XY8_UNDEFINED; // Ride name if (rideEntryIndex == RIDE_ENTRY_INDEX_NULL) @@ -144,9 +144,9 @@ public: } for (size_t i = 0; i < RCT12_MAX_STATIONS_PER_RIDE; i++) { - ride->station_starts[i] = 0xFFFF; - ride->entrances[i] = 0xFFFF; - ride->exits[i] = 0xFFFF; + ride->station_starts[i].xy = RCT_XY8_UNDEFINED; + ride->entrances[i].xy = RCT_XY8_UNDEFINED; + ride->exits[i].xy = RCT_XY8_UNDEFINED; ride->train_at_station[i] = 255; ride->queue_time[i] = 0; } diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index 9e9a57f5b8..b4f053d958 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -65,10 +65,10 @@ public: return GameActionResult(GA_ERROR::INVALID_PARAMETERS, STR_INVALID_SELECTION_OF_OBJECTS); } - if (ride->overall_view != (uint16)-1) + if (ride->overall_view.xy != RCT_XY8_UNDEFINED) { - res.Position.x = (ride->overall_view & 0xFF) * 32 + 16; - res.Position.y = (ride->overall_view >> 8) * 32 + 16; + res.Position.x = ride->overall_view.x * 32 + 16; + res.Position.y = ride->overall_view.y * 32 + 16; res.Position.z = map_element_height(res.Position.x, res.Position.y); }