mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Move .suggestedGuestMaximum into ParkData struct
This commit is contained in:
@@ -105,11 +105,6 @@ namespace OpenRCT2
|
|||||||
|
|
||||||
ObjectEntryIndex lastEntranceStyle;
|
ObjectEntryIndex lastEntranceStyle;
|
||||||
|
|
||||||
/**
|
|
||||||
* In a difficult guest generation scenario, no guests will be generated if over this value.
|
|
||||||
*/
|
|
||||||
uint32_t suggestedGuestMaximum;
|
|
||||||
|
|
||||||
CheatsState cheats;
|
CheatsState cheats;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ namespace OpenRCT2
|
|||||||
auto& gameState = getGameState();
|
auto& gameState = getGameState();
|
||||||
|
|
||||||
serialiser << gameState.park.guestGenerationProbability;
|
serialiser << gameState.park.guestGenerationProbability;
|
||||||
serialiser << gameState.suggestedGuestMaximum;
|
serialiser << gameState.park.suggestedGuestMaximum;
|
||||||
serialiser << Config::Get().general.ShowRealNamesOfGuests;
|
serialiser << Config::Get().general.ShowRealNamesOfGuests;
|
||||||
|
|
||||||
// To make this a little bit less volatile against updates
|
// To make this a little bit less volatile against updates
|
||||||
|
|||||||
@@ -1002,7 +1002,7 @@ namespace OpenRCT2
|
|||||||
cs.ReadWrite(gameState.park.numGuestsInParkLastWeek);
|
cs.ReadWrite(gameState.park.numGuestsInParkLastWeek);
|
||||||
cs.ReadWrite(gameState.park.guestChangeModifier);
|
cs.ReadWrite(gameState.park.guestChangeModifier);
|
||||||
cs.ReadWrite(gameState.park.guestGenerationProbability);
|
cs.ReadWrite(gameState.park.guestGenerationProbability);
|
||||||
cs.ReadWrite(gameState.suggestedGuestMaximum);
|
cs.ReadWrite(gameState.park.suggestedGuestMaximum);
|
||||||
|
|
||||||
cs.ReadWriteArray(gameState.peepWarningThrottle, [&cs](uint8_t& value) {
|
cs.ReadWriteArray(gameState.peepWarningThrottle, [&cs](uint8_t& value) {
|
||||||
cs.ReadWrite(value);
|
cs.ReadWrite(value);
|
||||||
|
|||||||
@@ -529,7 +529,7 @@ namespace OpenRCT2::RCT2
|
|||||||
gameState.mapSize = { _s6.MapSize, _s6.MapSize };
|
gameState.mapSize = { _s6.MapSize, _s6.MapSize };
|
||||||
gameState.park.samePriceThroughoutPark = _s6.SamePriceThroughout
|
gameState.park.samePriceThroughoutPark = _s6.SamePriceThroughout
|
||||||
| (static_cast<uint64_t>(_s6.SamePriceThroughoutExtended) << 32);
|
| (static_cast<uint64_t>(_s6.SamePriceThroughoutExtended) << 32);
|
||||||
gameState.suggestedGuestMaximum = _s6.SuggestedMaxGuests;
|
gameState.park.suggestedGuestMaximum = _s6.SuggestedMaxGuests;
|
||||||
gameState.scenarioParkRatingWarningDays = _s6.ParkRatingWarningDays;
|
gameState.scenarioParkRatingWarningDays = _s6.ParkRatingWarningDays;
|
||||||
gameState.lastEntranceStyle = _s6.LastEntranceStyle;
|
gameState.lastEntranceStyle = _s6.LastEntranceStyle;
|
||||||
// rct1_water_colour
|
// rct1_water_colour
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace OpenRCT2::Scripting
|
|||||||
|
|
||||||
uint32_t ScPark::suggestedGuestMaximum_get() const
|
uint32_t ScPark::suggestedGuestMaximum_get() const
|
||||||
{
|
{
|
||||||
return getGameState().suggestedGuestMaximum;
|
return getGameState().park.suggestedGuestMaximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ScPark::guestGenerationProbability_get() const
|
int32_t ScPark::guestGenerationProbability_get() const
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ namespace OpenRCT2::Park
|
|||||||
|
|
||||||
// The more guests, the lower the chance of a new one
|
// The more guests, the lower the chance of a new one
|
||||||
uint32_t numGuests = gameState.park.numGuestsInPark + gameState.park.numGuestsHeadingForPark;
|
uint32_t numGuests = gameState.park.numGuestsInPark + gameState.park.numGuestsHeadingForPark;
|
||||||
if (numGuests > gameState.suggestedGuestMaximum)
|
if (numGuests > gameState.park.suggestedGuestMaximum)
|
||||||
{
|
{
|
||||||
probability /= 4;
|
probability /= 4;
|
||||||
// Even lower for difficult guest generation
|
// Even lower for difficult guest generation
|
||||||
@@ -235,7 +235,7 @@ namespace OpenRCT2::Park
|
|||||||
if (static_cast<int32_t>(ScenarioRand() & 0xFFFF) < gameState.park.guestGenerationProbability)
|
if (static_cast<int32_t>(ScenarioRand() & 0xFFFF) < gameState.park.guestGenerationProbability)
|
||||||
{
|
{
|
||||||
bool difficultGeneration = (gameState.park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION) != 0;
|
bool difficultGeneration = (gameState.park.Flags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION) != 0;
|
||||||
if (!difficultGeneration || gameState.suggestedGuestMaximum + 150 >= gameState.park.numGuestsInPark)
|
if (!difficultGeneration || gameState.park.suggestedGuestMaximum + 150 >= gameState.park.numGuestsInPark)
|
||||||
{
|
{
|
||||||
GenerateGuest();
|
GenerateGuest();
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ namespace OpenRCT2::Park
|
|||||||
gameState.park.Rating = 0;
|
gameState.park.Rating = 0;
|
||||||
gameState.park.guestGenerationProbability = 0;
|
gameState.park.guestGenerationProbability = 0;
|
||||||
gameState.park.totalRideValueForMoney = 0;
|
gameState.park.totalRideValueForMoney = 0;
|
||||||
gameState.suggestedGuestMaximum = 0;
|
gameState.park.suggestedGuestMaximum = 0;
|
||||||
gameState.researchLastItem = std::nullopt;
|
gameState.researchLastItem = std::nullopt;
|
||||||
gameState.park.marketingCampaigns.clear();
|
gameState.park.marketingCampaigns.clear();
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ namespace OpenRCT2::Park
|
|||||||
gameState.park.Value = Park::CalculateParkValue();
|
gameState.park.Value = Park::CalculateParkValue();
|
||||||
gameState.park.companyValue = CalculateCompanyValue();
|
gameState.park.companyValue = CalculateCompanyValue();
|
||||||
gameState.park.totalRideValueForMoney = calculateTotalRideValueForMoney();
|
gameState.park.totalRideValueForMoney = calculateTotalRideValueForMoney();
|
||||||
gameState.suggestedGuestMaximum = calculateSuggestedMaxGuests();
|
gameState.park.suggestedGuestMaximum = calculateSuggestedMaxGuests();
|
||||||
gameState.park.guestGenerationProbability = calculateGuestGenerationProbability();
|
gameState.park.guestGenerationProbability = calculateGuestGenerationProbability();
|
||||||
|
|
||||||
windowMgr->InvalidateByClass(WindowClass::Finances);
|
windowMgr->InvalidateByClass(WindowClass::Finances);
|
||||||
|
|||||||
@@ -99,6 +99,11 @@ namespace OpenRCT2::Park
|
|||||||
*/
|
*/
|
||||||
int32_t guestGenerationProbability;
|
int32_t guestGenerationProbability;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* In a difficult guest generation scenario, no guests will be generated if over this value.
|
||||||
|
*/
|
||||||
|
uint32_t suggestedGuestMaximum;
|
||||||
|
|
||||||
uint64_t totalAdmissions;
|
uint64_t totalAdmissions;
|
||||||
money64 totalIncomeFromAdmissions;
|
money64 totalIncomeFromAdmissions;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user