mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move ride_update_satisfaction() to method
This commit is contained in:
parent
2f20dc029e
commit
6df7c1e3b0
|
@ -1605,7 +1605,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price)
|
|||
satisfaction++;
|
||||
}
|
||||
}
|
||||
ride_update_satisfaction(ride, satisfaction);
|
||||
ride->UpdateSatisfaction(satisfaction);
|
||||
}
|
||||
|
||||
// The peep has now decided to buy the item (or, specifically, has not been
|
||||
|
@ -1724,7 +1724,7 @@ void Guest::OnEnterRide(Ride* ride)
|
|||
else if (satisfaction >= 0)
|
||||
rideSatisfaction = 1;
|
||||
|
||||
ride_update_satisfaction(ride, rideSatisfaction);
|
||||
ride->UpdateSatisfaction(rideSatisfaction);
|
||||
|
||||
// Update various peep stats.
|
||||
if (GuestNumRides < 255)
|
||||
|
@ -3286,7 +3286,7 @@ static bool peep_should_use_cash_machine(Guest* peep, ride_id_t rideIndex)
|
|||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
ride_update_satisfaction(ride, peep->Happiness >> 6);
|
||||
ride->UpdateSatisfaction(peep->Happiness >> 6);
|
||||
ride->cur_num_customers++;
|
||||
ride->total_customers++;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
|
||||
|
@ -5051,7 +5051,7 @@ void Guest::UpdateRideShopLeave()
|
|||
{
|
||||
ride->total_customers++;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
|
||||
ride_update_satisfaction(ride, Happiness / 64);
|
||||
ride->UpdateSatisfaction(Happiness / 64);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1087,16 +1087,16 @@ void Ride::UpdateChairlift()
|
|||
* edi: ride (in code as bytes offset from start of rides list)
|
||||
* bl: happiness
|
||||
*/
|
||||
void ride_update_satisfaction(Ride* ride, uint8_t happiness)
|
||||
void Ride::UpdateSatisfaction(const uint8_t happiness)
|
||||
{
|
||||
ride->satisfaction_next += happiness;
|
||||
ride->satisfaction_time_out++;
|
||||
if (ride->satisfaction_time_out >= 20)
|
||||
satisfaction_next += happiness;
|
||||
satisfaction_time_out++;
|
||||
if (satisfaction_time_out >= 20)
|
||||
{
|
||||
ride->satisfaction = ride->satisfaction_next >> 2;
|
||||
ride->satisfaction_next = 0;
|
||||
ride->satisfaction_time_out = 0;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
|
||||
satisfaction = satisfaction_next >> 2;
|
||||
satisfaction_next = 0;
|
||||
satisfaction_time_out = 0;
|
||||
window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -374,6 +374,8 @@ public:
|
|||
* they belong to, to enable “merging”.)
|
||||
*/
|
||||
void UpdateRideTypeForAllPieces();
|
||||
|
||||
void UpdateSatisfaction(const uint8_t happiness);
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
@ -1023,7 +1025,7 @@ void ride_init_all();
|
|||
void reset_all_ride_build_dates();
|
||||
void ride_update_favourited_stat();
|
||||
void ride_check_all_reachable();
|
||||
void ride_update_satisfaction(Ride* ride, uint8_t happiness);
|
||||
|
||||
void ride_update_popularity(Ride* ride, uint8_t pop_amount);
|
||||
bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output);
|
||||
int32_t ride_find_track_gap(const Ride* ride, CoordsXYE* input, CoordsXYE* output);
|
||||
|
|
Loading…
Reference in New Issue