Use only ints

This commit is contained in:
David Markowitz 2023-05-10 01:32:55 -07:00
parent 4dba8d9225
commit af1abe9e74
3 changed files with 9 additions and 9 deletions

View File

@ -182,7 +182,7 @@ std::string Leaderboard::GetInsertFormat(Leaderboard::Type leaderboardType) {
std::string columns; std::string columns;
switch (leaderboardType) { switch (leaderboardType) {
case Type::ShootingGallery: case Type::ShootingGallery:
columns = "score=%i, hitPercentage=%f, streak=%i"; columns = "score=%i, hitPercentage=%i, streak=%i";
break; break;
case Type::Racing: case Type::Racing:
columns = "bestLapTime=%i, bestTime=%i, numWins=numWins + %i"; columns = "bestLapTime=%i, bestTime=%i, numWins=numWins + %i";
@ -407,9 +407,9 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, GameID gameID, Lead
int32_t score; int32_t score;
score = va_arg(argsCopy, int32_t); score = va_arg(argsCopy, int32_t);
float oldHitPercentage = myScoreResult->getFloat("hitPercentage"); int32_t oldHitPercentage = myScoreResult->getFloat("hitPercentage");
float hitPercentage; int32_t hitPercentage;
hitPercentage = va_arg(argsCopy, double); hitPercentage = va_arg(argsCopy, int32_t);
int32_t oldStreak = myScoreResult->getInt("streak"); int32_t oldStreak = myScoreResult->getInt("streak");
int32_t streak; int32_t streak;

View File

@ -87,7 +87,7 @@ void ActivityManager::SaveScore(Entity* self, LWOOBJID playerID, uint32_t val1,
uint32_t gameID = sac != nullptr ? sac->GetActivityID() : self->GetLOT(); uint32_t gameID = sac != nullptr ? sac->GetActivityID() : self->GetLOT();
// Save the new score to the leaderboard and show the leaderboard to the player // Save the new score to the leaderboard and show the leaderboard to the player
auto leaderboardType = LeaderboardManager::GetLeaderboardType(gameID); auto leaderboardType = LeaderboardManager::GetLeaderboardType(gameID);
Game::logger->Log("ActivityManager", "leaderboard type %i %i", leaderboardType, gameID); Game::logger->Log("ActivityManager", "leaderboard type %i %i args %i %i %i", leaderboardType, gameID, val1, val2, val3);
LeaderboardManager::Instance().SaveScore(playerID, gameID, leaderboardType, 3, val1, val2, val3); LeaderboardManager::Instance().SaveScore(playerID, gameID, leaderboardType, 3, val1, val2, val3);
// Makes the leaderboard show up for the player // Makes the leaderboard show up for the player

View File

@ -546,13 +546,13 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
// The player won, store all the score and send rewards // The player won, store all the score and send rewards
if (!cancel) { if (!cancel) {
auto percentage = 0; int32_t percentage = 50;
auto misses = self->GetVar<uint32_t>(MissesVariable); auto misses = self->GetVar<uint32_t>(MissesVariable);
auto fired = self->GetVar<uint32_t>(ShotsFiredVariable); auto fired = self->GetVar<uint32_t>(ShotsFiredVariable);
if (fired > 0) { // if (fired > 0) {
percentage = misses / fired; // percentage = misses / fired;
} // }
auto* missionComponent = player->GetComponent<MissionComponent>(); auto* missionComponent = player->GetComponent<MissionComponent>();