patched coin exploit

This commit is contained in:
Jett
2021-12-11 13:21:00 +00:00
parent e31dc35733
commit b6453376e4
5 changed files with 45 additions and 1 deletions

View File

@@ -1031,6 +1031,10 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID,
entity->AddLootItem(info);
}
if (item == LOT_NULL && currency != 0) {
entity->DropCoins(currency);
}
if (spawnPos != NiPoint3::ZERO) {
bUsePosition = true;
@@ -5232,8 +5236,12 @@ void GameMessages::HandlePickupCurrency(RakNet::BitStream* inStream, Entity* ent
unsigned int currency;
inStream->Read(currency);
if (currency == 0) return;
auto* ch = entity->GetCharacter();
ch->SetCoins(ch->GetCoins() + currency);
if (entity->PickupCoins(currency)) {
ch->SetCoins(ch->GetCoins() + currency);
}
}
void GameMessages::HandleRequestDie(RakNet::BitStream* inStream, Entity* entity) {