Added Player Rewards for Solo Racing (#1150)

* Added Player Rewards for Solo Racing

* Fixed Dual PlayersRating multiplication

* Checking for solo player fixed

* Another change to fix issues
This commit is contained in:
TAHuntling 2023-07-21 19:37:31 -05:00 committed by GitHub
parent 11b0097488
commit 342da56678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,8 +374,12 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player, int32_t bu
data->collectedRewards = true; data->collectedRewards = true;
// Calculate the score, different loot depending on player count // Calculate the score, different loot depending on player count
const auto score = m_LoadedPlayers * 10 + data->finished; auto playersRating = m_LoadedPlayers;
if(m_LoadedPlayers == 1 && m_SoloRacing) {
playersRating *= 2;
}
const auto score = playersRating * 10 + data->finished;
LootGenerator::Instance().GiveActivityLoot(player, m_Parent, m_ActivityID, score); LootGenerator::Instance().GiveActivityLoot(player, m_Parent, m_ActivityID, score);
// Giving rewards // Giving rewards