forked from rosebudai/OpenRCT2-Web
Use CoordsXYZ for cable lift location
This commit is contained in:
1 parent
a3a4a7f153
commit
38434ad688
5 files changed
+10
-17
No files matched your search
@@ -521,9 +521,7 @@ public:
|
||||
if (trackBlock->index != 0)
|
||||
break;
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED;
|
||||
ride->cable_lift_x = mapLoc.x;
|
||||
ride->cable_lift_y = mapLoc.y;
|
||||
ride->cable_lift_z = baseZ;
|
||||
ride->CableLiftLoc = { mapLoc, baseZ * 8 };
|
||||
break;
|
||||
case TRACK_ELEM_BLOCK_BRAKES:
|
||||
ride->num_block_brakes++;
|
||||
|
||||
@@ -741,9 +741,9 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
|
||||
dst->total_air_time = src->total_air_time;
|
||||
dst->current_test_station = src->current_test_station;
|
||||
dst->num_circuits = src->num_circuits;
|
||||
dst->cable_lift_x = src->cable_lift_x;
|
||||
dst->cable_lift_y = src->cable_lift_y;
|
||||
dst->cable_lift_z = src->cable_lift_z;
|
||||
dst->cable_lift_x = static_cast<int16_t>(src->CableLiftLoc.x);
|
||||
dst->cable_lift_y = static_cast<int16_t>(src->CableLiftLoc.y);
|
||||
dst->cable_lift_z = static_cast<int16_t>(src->CableLiftLoc.z);
|
||||
// pad_1FD;
|
||||
dst->cable_lift = src->cable_lift;
|
||||
|
||||
|
||||
@@ -760,9 +760,7 @@ public:
|
||||
dst->total_air_time = src->total_air_time;
|
||||
dst->current_test_station = src->current_test_station;
|
||||
dst->num_circuits = src->num_circuits;
|
||||
dst->cable_lift_x = src->cable_lift_x;
|
||||
dst->cable_lift_y = src->cable_lift_y;
|
||||
dst->cable_lift_z = src->cable_lift_z;
|
||||
dst->CableLiftLoc = { src->cable_lift_x, src->cable_lift_y, src->cable_lift_z };
|
||||
// pad_1FD;
|
||||
dst->cable_lift = src->cable_lift;
|
||||
|
||||
|
||||
@@ -5053,10 +5053,8 @@ static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying)
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t x = ride->cable_lift_x;
|
||||
int32_t y = ride->cable_lift_y;
|
||||
int32_t z = ride->cable_lift_z;
|
||||
auto tileElement = map_get_track_element_at(x, y, z);
|
||||
auto cableLiftLoc = ride->CableLiftLoc;
|
||||
auto tileElement = map_get_track_element_at(cableLiftLoc.x, cableLiftLoc.y, cableLiftLoc.z / 8);
|
||||
int32_t direction = tileElement->GetDirection();
|
||||
|
||||
rct_vehicle* head = nullptr;
|
||||
@@ -5071,7 +5069,8 @@ static bool ride_create_cable_lift(ride_id_t rideIndex, bool isApplying)
|
||||
int32_t remaining_distance = ebx;
|
||||
ebx -= edx;
|
||||
|
||||
rct_vehicle* current = cable_lift_segment_create(*ride, x, y, z, direction, var_44, remaining_distance, i == 0);
|
||||
rct_vehicle* current = cable_lift_segment_create(
|
||||
*ride, cableLiftLoc.x, cableLiftLoc.y, cableLiftLoc.z / 8, direction, var_44, remaining_distance, i == 0);
|
||||
current->next_vehicle_on_train = SPRITE_INDEX_NULL;
|
||||
if (i == 0)
|
||||
{
|
||||
|
||||
@@ -369,9 +369,7 @@ struct Ride
|
||||
uint16_t total_air_time;
|
||||
uint8_t current_test_station;
|
||||
uint8_t num_circuits;
|
||||
int16_t cable_lift_x;
|
||||
int16_t cable_lift_y;
|
||||
uint8_t cable_lift_z;
|
||||
CoordsXYZ CableLiftLoc;
|
||||
uint16_t cable_lift;
|
||||
// These fields are used to warn users about issues.
|
||||
// Such issue can be hacked rides with incompatible options set.
|
||||
|
||||
Reference in new issue
Block a user