mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-09 08:01:12 +00:00
add check for jetpack
Update LeaderboardManager.cpp
This commit is contained in:
parent
99f6cf2d92
commit
3cdb02ff49
@ -268,6 +268,9 @@ void Leaderboard::Send(const LWOOBJID targetID) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activityId, const float primaryScore, const float secondaryScore, const float tertiaryScore) {
|
void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activityId, const float primaryScore, const float secondaryScore, const float tertiaryScore) {
|
||||||
|
const auto* const playerEntity = Game::entityManager->GetEntity(playerID);
|
||||||
|
if (playerEntity && playerEntity->GetVar<bool>(u"cheated_score")) return;
|
||||||
|
|
||||||
const Leaderboard::Type leaderboardType = GetLeaderboardType(activityId);
|
const Leaderboard::Type leaderboardType = GetLeaderboardType(activityId);
|
||||||
|
|
||||||
const auto oldScore = Database::Get()->GetPlayerScore(playerID, activityId);
|
const auto oldScore = Database::Get()->GetPlayerScore(playerID, activityId);
|
||||||
|
@ -42,6 +42,10 @@
|
|||||||
|
|
||||||
#include <ranges>
|
#include <ranges>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
std::vector<LOT> g_RestrictedLOTs = {1727,};
|
||||||
|
};
|
||||||
|
|
||||||
InventoryComponent::InventoryComponent(Entity* parent) : Component(parent) {
|
InventoryComponent::InventoryComponent(Entity* parent) : Component(parent) {
|
||||||
this->m_Dirty = true;
|
this->m_Dirty = true;
|
||||||
this->m_Equipped = {};
|
this->m_Equipped = {};
|
||||||
@ -870,6 +874,8 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
} else if (std::ranges::find(g_RestrictedLOTs, item->GetLot()) != g_RestrictedLOTs.end()) {
|
||||||
|
m_Parent->SetVar<bool>(u"cheated_score", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto building = character->GetBuildMode();
|
const auto building = character->GetBuildMode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user