mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
patched coin exploit
This commit is contained in:
@@ -1644,6 +1644,24 @@ void Entity::PickupItem(const LWOOBJID& objectID) {
|
||||
droppedLoot.erase(objectID);
|
||||
}
|
||||
|
||||
bool Entity::PickupCoins(uint64_t count) { // bool because we are returning whether they can pick up the coins
|
||||
if (!IsPlayer()) return false;
|
||||
auto droppedcoins = static_cast<Player*>(this)->GetDroppedCoins();
|
||||
if (count > droppedcoins) {
|
||||
return false;
|
||||
} else {
|
||||
static_cast<Player*>(this)->SetDroppedCoins(droppedcoins - count);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void Entity::DropCoins(uint64_t count) {
|
||||
if (!IsPlayer()) return;
|
||||
auto droppedcoins = static_cast<Player*>(this)->GetDroppedCoins();
|
||||
droppedcoins += count;
|
||||
static_cast<Player*>(this)->SetDroppedCoins(droppedcoins);
|
||||
}
|
||||
|
||||
void Entity::AddChild(Entity* child) {
|
||||
m_ChildEntities.push_back(child);
|
||||
}
|
||||
|
Reference in New Issue
Block a user