diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 0579035e..dbb44f2f 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -1658,9 +1658,10 @@ bool Entity::CanPickupCoins(uint64_t count) { // bool because we are returning w void Entity::RegisterCoinDrop(uint64_t count) { if (!IsPlayer()) return; - auto droppedcoins = static_cast(this)->GetDroppedCoins(); + auto * player = static_cast(this); + auto droppedcoins = player->GetDroppedCoins(); droppedcoins += count; - static_cast(this)->SetDroppedCoins(droppedcoins); + player->SetDroppedCoins(droppedcoins); } void Entity::AddChild(Entity* child) {