1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-24 15:37:46 +00:00

Fix hasStatusEffect to prevent duplicates

This commit is contained in:
Lucy 2023-03-07 19:59:11 +01:00
parent bfaec90e00
commit 7ad9f9687e

View file

@ -698,7 +698,13 @@ void Sapphire::Entity::Chara::updateStatusEffects()
bool Sapphire::Entity::Chara::hasStatusEffect( uint32_t id ) 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 int64_t Sapphire::Entity::Chara::getLastUpdateTime() const