buffRemoval (#1464)

Update BuffComponent.cpp
This commit is contained in:
David Markowitz
2024-02-24 23:01:28 -08:00
committed by GitHub
parent 721ea78bb4
commit 1328850a8d
2 changed files with 4 additions and 5 deletions

View File

@@ -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) {
const auto& iter = m_Buffs.find(id);
if (iter == m_Buffs.end()) {
return;
}
// If the buff is already scheduled to be removed, don't do it again
if (iter == m_Buffs.end() || m_BuffsToRemove.contains(id)) return;
if (!ignoreRefCount && !iter->second.cancelOnRemoveBuff) {
iter->second.refCount--;
@@ -222,7 +221,7 @@ void BuffComponent::RemoveBuff(int32_t id, bool fromUnEquip, bool removeImmunity
GameMessages::SendRemoveBuff(m_Parent, fromUnEquip, removeImmunity, id);
m_BuffsToRemove.push_back(id);
m_BuffsToRemove.insert(id);
RemoveBuffEffect(id);
}