mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Changes asked for by Wincent
This commit is contained in:
parent
b6453376e4
commit
22de531ab3
@ -1644,7 +1644,7 @@ void Entity::PickupItem(const LWOOBJID& objectID) {
|
|||||||
droppedLoot.erase(objectID);
|
droppedLoot.erase(objectID);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Entity::PickupCoins(uint64_t count) { // bool because we are returning whether they can pick up the coins
|
bool Entity::CanPickupCoins(uint64_t count) { // bool because we are returning whether they can pick up the coins
|
||||||
if (!IsPlayer()) return false;
|
if (!IsPlayer()) return false;
|
||||||
auto droppedcoins = static_cast<Player*>(this)->GetDroppedCoins();
|
auto droppedcoins = static_cast<Player*>(this)->GetDroppedCoins();
|
||||||
if (count > droppedcoins) {
|
if (count > droppedcoins) {
|
||||||
@ -1655,7 +1655,7 @@ bool Entity::PickupCoins(uint64_t count) { // bool because we are returning whet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entity::DropCoins(uint64_t count) {
|
void Entity::RegisterCoinDrop(uint64_t count) {
|
||||||
if (!IsPlayer()) return;
|
if (!IsPlayer()) return;
|
||||||
auto droppedcoins = static_cast<Player*>(this)->GetDroppedCoins();
|
auto droppedcoins = static_cast<Player*>(this)->GetDroppedCoins();
|
||||||
droppedcoins += count;
|
droppedcoins += count;
|
||||||
|
@ -202,8 +202,8 @@ public:
|
|||||||
void AddLootItem(const Loot::Info& info);
|
void AddLootItem(const Loot::Info& info);
|
||||||
void PickupItem(const LWOOBJID& objectID);
|
void PickupItem(const LWOOBJID& objectID);
|
||||||
|
|
||||||
bool PickupCoins(uint64_t count);
|
bool CanPickupCoins(uint64_t count);
|
||||||
void DropCoins(uint64_t count);
|
void RegisterCoinDrop(uint64_t count);
|
||||||
|
|
||||||
void ScheduleKillAfterUpdate(Entity* murderer = nullptr);
|
void ScheduleKillAfterUpdate(Entity* murderer = nullptr);
|
||||||
void TriggerEvent(std::string eveneventtID, Entity* optionalTarget = nullptr);
|
void TriggerEvent(std::string eveneventtID, Entity* optionalTarget = nullptr);
|
||||||
|
@ -1032,7 +1032,7 @@ void GameMessages::SendDropClientLoot(Entity* entity, const LWOOBJID& sourceID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item == LOT_NULL && currency != 0) {
|
if (item == LOT_NULL && currency != 0) {
|
||||||
entity->DropCoins(currency);
|
entity->RegisterCoinDrop(currency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spawnPos != NiPoint3::ZERO) {
|
if (spawnPos != NiPoint3::ZERO) {
|
||||||
@ -5239,7 +5239,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->PickupCoins(currency)) {
|
if (entity->CanPickupCoins(currency)) {
|
||||||
ch->SetCoins(ch->GetCoins() + currency);
|
ch->SetCoins(ch->GetCoins() + currency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user