forked from rosebudai/OpenRCT2-Web
Move ride_get_total_time() to method
This commit is contained in:
3 files changed
+5
-5
No files matched your search
@@ -836,11 +836,11 @@ int32_t Ride::GetTotalLength() const
|
||||
return totalLength;
|
||||
}
|
||||
|
||||
int32_t ride_get_total_time(Ride* ride)
|
||||
int32_t Ride::GetTotalTime() const
|
||||
{
|
||||
int32_t i, totalTime = 0;
|
||||
for (i = 0; i < ride->num_stations; i++)
|
||||
totalTime += ride->stations[i].SegmentTime;
|
||||
for (i = 0; i < num_stations; i++)
|
||||
totalTime += stations[i].SegmentTime;
|
||||
return totalTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -380,6 +380,7 @@ public:
|
||||
void RemovePeeps();
|
||||
|
||||
int32_t GetTotalLength() const;
|
||||
int32_t GetTotalTime() const;
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -1038,7 +1039,6 @@ bool ride_modify(CoordsXYE* input);
|
||||
void ride_clear_blocked_tiles(Ride* ride);
|
||||
Staff* ride_get_mechanic(Ride* ride);
|
||||
Staff* ride_get_assigned_mechanic(Ride* ride);
|
||||
int32_t ride_get_total_time(Ride* ride);
|
||||
TrackColour ride_get_track_colour(Ride* ride, int32_t colourScheme);
|
||||
VehicleColour ride_get_vehicle_colour(Ride* ride, int32_t vehicleIndex);
|
||||
int32_t ride_get_unused_preset_vehicle_colour(ObjectEntryIndex subType);
|
||||
|
||||
@@ -1537,7 +1537,7 @@ static void ride_ratings_apply_average_speed(
|
||||
|
||||
static void ride_ratings_apply_duration(RatingTuple* ratings, Ride* ride, int32_t maxDuration, int32_t excitementMultiplier)
|
||||
{
|
||||
ride_ratings_add(ratings, (std::min(ride_get_total_time(ride), maxDuration) * excitementMultiplier) >> 16, 0, 0);
|
||||
ride_ratings_add(ratings, (std::min(ride->GetTotalTime(), maxDuration) * excitementMultiplier) >> 16, 0, 0);
|
||||
}
|
||||
|
||||
static void ride_ratings_apply_gforces(
|
||||
|
||||
Reference in new issue
Block a user