From bb508e91c1d52de0b97b33edd1bbcf7721a9f08a Mon Sep 17 00:00:00 2001 From: wincent Date: Sat, 11 Dec 2021 17:33:54 +0100 Subject: [PATCH] Update the code style When applied this commit updates the code style used when validating coin pickups. --- dGame/Entity.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index dbb44f2f..ad9b8cd5 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -1644,24 +1644,24 @@ void Entity::PickupItem(const LWOOBJID& objectID) { droppedLoot.erase(objectID); } -bool Entity::CanPickupCoins(uint64_t count) { // bool because we are returning whether they can pick up the coins +bool Entity::CanPickupCoins(uint64_t count) { if (!IsPlayer()) return false; - auto * player = static_cast(this); - auto droppedcoins = player->GetDroppedCoins(); - if (count > droppedcoins) { + auto* player = static_cast(this); + auto droppedCoins = player->GetDroppedCoins(); + if (count > droppedCoins) { return false; } else { - player->SetDroppedCoins(droppedcoins - count); + player->SetDroppedCoins(droppedCoins - count); return true; } } void Entity::RegisterCoinDrop(uint64_t count) { if (!IsPlayer()) return; - auto * player = static_cast(this); - auto droppedcoins = player->GetDroppedCoins(); - droppedcoins += count; - player->SetDroppedCoins(droppedcoins); + auto* player = static_cast(this); + auto droppedCoins = player->GetDroppedCoins(); + droppedCoins += count; + player->SetDroppedCoins(droppedCoins); } void Entity::AddChild(Entity* child) {