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:
parent
bfaec90e00
commit
7ad9f9687e
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue