Use `TrackCoordinates`

This commit is contained in:
Marijn van der Werf 2016-08-03 01:49:05 +02:00
parent d0bb8597d9
commit 1fc5681f00
3 changed files with 6 additions and 6 deletions

View File

@ -4320,7 +4320,7 @@ static void ride_set_boat_hire_return_point(rct_ride *ride, rct_xy_element *star
};
trackType = returnTrackElement->properties.track.type;
int elementReturnDirection = RCT2_GLOBAL(0x009968BB + (trackType * 10), uint8);
int elementReturnDirection = TrackCoordinates[trackType].rotation_begin;
ride->boat_hire_return_direction = (returnTrackElement->type + elementReturnDirection) & 3;
ride->boat_hire_return_position = (returnX >> 5) | ((returnY >> 5) << 8);
}

View File

@ -2729,7 +2729,7 @@ money32 sub_6CA162(int rideIndex, int trackType, int trackDirection, int edxRS16
RCT2_GLOBAL(0x00F440C7, uint16) = y;
z += ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) ?
RCT2_GLOBAL(0x009972BD + (trackType * 10), uint16) :
RCT2_GLOBAL(0x009968BD + (trackType * 10), uint16);
TrackCoordinates[trackType].z_begin;
RCT2_GLOBAL(0x00F440C9, uint16) = z;
RCT2_GLOBAL(0x00F440CB, uint8) = trackDirection;

View File

@ -3175,11 +3175,11 @@ static bool map_place_fence_check_obstruction_with_track(rct_scenery_entry *wall
}
if (TrackDefinitions[trackType].bank_start == 0) {
if (!(RCT2_ADDRESS(0x009968BB, uint8)[trackType * 10] & 4)) {
if (!(TrackCoordinates[trackType].rotation_begin & 4)) {
direction = (trackElement->type & 3) ^ 2;
if (direction == edge) {
trackBlock = &TrackBlocks[trackType][sequence];
z = RCT2_GLOBAL(0x009968BD + (trackType * 10), uint8);
z = TrackCoordinates[trackType].z_begin;
z = trackElement->base_height + ((z - trackBlock->z) * 8);
if (z == z0) {
return true;
@ -3198,7 +3198,7 @@ static bool map_place_fence_check_obstruction_with_track(rct_scenery_entry *wall
return false;
}
direction = RCT2_ADDRESS(0x009968BC, uint8)[trackType * 10];
direction = TrackCoordinates[trackType].rotation_end;
if (direction & 4) {
return false;
}
@ -3209,7 +3209,7 @@ static bool map_place_fence_check_obstruction_with_track(rct_scenery_entry *wall
}
trackBlock = &TrackBlocks[trackType][sequence];
z = RCT2_GLOBAL(0x009968BF + (trackType * 10), uint8);
z = TrackCoordinates[trackType].z_end;
z = trackElement->base_height + ((z - trackBlock->z) * 8);
if (z != z0) {
return false;