Fix using rct_xy8 incorrect.

This commit is contained in:
ZehMatt 2017-07-19 22:48:46 +02:00 committed by Michał Janiszewski
parent f29dc3ff34
commit 22750a95e4
2 changed files with 7 additions and 7 deletions

View File

@ -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;
}

View File

@ -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);
}