mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-07 03:04:05 +00:00
Add null check for character (#1814)
This commit is contained in:
@@ -5207,7 +5207,7 @@ void GameMessages::HandlePickupCurrency(RakNet::BitStream& inStream, Entity* ent
|
|||||||
if (currency == 0) return;
|
if (currency == 0) return;
|
||||||
|
|
||||||
auto* ch = entity->GetCharacter();
|
auto* ch = entity->GetCharacter();
|
||||||
if (entity->CanPickupCoins(currency)) {
|
if (ch && entity->CanPickupCoins(currency)) {
|
||||||
ch->SetCoins(ch->GetCoins() + currency, eLootSourceType::PICKUP);
|
ch->SetCoins(ch->GetCoins() + currency, eLootSourceType::PICKUP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user