mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
parent
721ea78bb4
commit
1328850a8d
@ -208,9 +208,8 @@ void BuffComponent::ApplyBuff(const int32_t id, const float duration, const LWOO
|
|||||||
void BuffComponent::RemoveBuff(int32_t id, bool fromUnEquip, bool removeImmunity, bool ignoreRefCount) {
|
void BuffComponent::RemoveBuff(int32_t id, bool fromUnEquip, bool removeImmunity, bool ignoreRefCount) {
|
||||||
const auto& iter = m_Buffs.find(id);
|
const auto& iter = m_Buffs.find(id);
|
||||||
|
|
||||||
if (iter == m_Buffs.end()) {
|
// If the buff is already scheduled to be removed, don't do it again
|
||||||
return;
|
if (iter == m_Buffs.end() || m_BuffsToRemove.contains(id)) return;
|
||||||
}
|
|
||||||
|
|
||||||
if (!ignoreRefCount && !iter->second.cancelOnRemoveBuff) {
|
if (!ignoreRefCount && !iter->second.cancelOnRemoveBuff) {
|
||||||
iter->second.refCount--;
|
iter->second.refCount--;
|
||||||
@ -222,7 +221,7 @@ void BuffComponent::RemoveBuff(int32_t id, bool fromUnEquip, bool removeImmunity
|
|||||||
|
|
||||||
GameMessages::SendRemoveBuff(m_Parent, fromUnEquip, removeImmunity, id);
|
GameMessages::SendRemoveBuff(m_Parent, fromUnEquip, removeImmunity, id);
|
||||||
|
|
||||||
m_BuffsToRemove.push_back(id);
|
m_BuffsToRemove.insert(id);
|
||||||
|
|
||||||
RemoveBuffEffect(id);
|
RemoveBuffEffect(id);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ private:
|
|||||||
std::map<int32_t, Buff> m_Buffs;
|
std::map<int32_t, Buff> m_Buffs;
|
||||||
|
|
||||||
// Buffs to remove at the end of the update frame.
|
// Buffs to remove at the end of the update frame.
|
||||||
std::vector<int32_t> m_BuffsToRemove;
|
std::set<int32_t> m_BuffsToRemove;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parameters (=effects) for each buff
|
* Parameters (=effects) for each buff
|
||||||
|
Loading…
Reference in New Issue
Block a user