From 7ad9f9687e8a435f83ef8c01545430a9f7bc0ace Mon Sep 17 00:00:00 2001 From: Lucy <44952533+Skyliegirl33@users.noreply.github.com> Date: Tue, 7 Mar 2023 19:59:11 +0100 Subject: [PATCH] Fix hasStatusEffect to prevent duplicates --- src/world/Actor/Chara.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index 66f8ef46..bb383efb 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -698,7 +698,13 @@ void Sapphire::Entity::Chara::updateStatusEffects() bool Sapphire::Entity::Chara::hasStatusEffect( uint32_t id ) { - return m_statusEffectMap.find( id ) != m_statusEffectMap.end(); + for( const auto& [ key, val ] : m_statusEffectMap ) + { + if( val->getId() == id ) + return true; + } + + return false; } int64_t Sapphire::Entity::Chara::getLastUpdateTime() const