Working in game!

- Add score saving for races
- Fix some bugs
- Still work to do.
This commit is contained in:
David Markowitz
2023-05-09 01:42:11 -07:00
parent 411c9eaf1f
commit 7a067e7b48
7 changed files with 46 additions and 31 deletions

View File

@@ -23,6 +23,7 @@
#include "dConfig.h"
#include "Loot.h"
#include "eMissionTaskType.h"
#include "LeaderboardManager.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
@@ -391,9 +392,7 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player,
}
if (id == "rewardButton") {
if (data->collectedRewards) {
return;
}
if (data->collectedRewards) return;
data->collectedRewards = true;
@@ -401,6 +400,8 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player,
const auto score = m_LoadedPlayers * 10 + data->finished;
LootGenerator::Instance().GiveActivityLoot(player, m_Parent, m_ActivityID, score);
auto leaderboardType = LeaderboardManager::Instance().GetLeaderboardType(m_ActivityID);
LeaderboardManager::Instance().SaveScore(player->GetObjectID(), m_ActivityID, leaderboardType, 3, data->bestLapTime, data->raceTime, data->finished == 1);
// Giving rewards
GameMessages::SendNotifyRacingClient(