mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Update the code style
When applied this commit updates the code style used when validating coin pickups.
This commit is contained in:
parent
94e32a5773
commit
bb508e91c1
@ -1644,14 +1644,14 @@ void Entity::PickupItem(const LWOOBJID& objectID) {
|
|||||||
droppedLoot.erase(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;
|
if (!IsPlayer()) return false;
|
||||||
auto* player = static_cast<Player*>(this);
|
auto* player = static_cast<Player*>(this);
|
||||||
auto droppedcoins = player->GetDroppedCoins();
|
auto droppedCoins = player->GetDroppedCoins();
|
||||||
if (count > droppedcoins) {
|
if (count > droppedCoins) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
player->SetDroppedCoins(droppedcoins - count);
|
player->SetDroppedCoins(droppedCoins - count);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1659,9 +1659,9 @@ bool Entity::CanPickupCoins(uint64_t count) { // bool because we are returning w
|
|||||||
void Entity::RegisterCoinDrop(uint64_t count) {
|
void Entity::RegisterCoinDrop(uint64_t count) {
|
||||||
if (!IsPlayer()) return;
|
if (!IsPlayer()) return;
|
||||||
auto* player = static_cast<Player*>(this);
|
auto* player = static_cast<Player*>(this);
|
||||||
auto droppedcoins = player->GetDroppedCoins();
|
auto droppedCoins = player->GetDroppedCoins();
|
||||||
droppedcoins += count;
|
droppedCoins += count;
|
||||||
player->SetDroppedCoins(droppedcoins);
|
player->SetDroppedCoins(droppedCoins);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entity::AddChild(Entity* child) {
|
void Entity::AddChild(Entity* child) {
|
||||||
|
Loading…
Reference in New Issue
Block a user