diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index 1923a26c..4cc09ec3 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -956,7 +956,6 @@ float Sapphire::Entity::Chara::applyShieldProtection( float damage ) { float remainingDamage = damage; bool shieldChanged = false; - std::vector< uint8_t > destroyedShieldSlotList; for( auto const& entry : getStatusEffectMap() ) { @@ -976,24 +975,14 @@ float Sapphire::Entity::Chara::applyShieldProtection( float damage ) else { remainingDamage -= effectEntry.effectValue1; - destroyedShieldSlotList.push_back( entry.first ); + status->markToRemove(); } } } if( shieldChanged ) - { - if( !destroyedShieldSlotList.empty() ) - { - for( auto const& slotId : destroyedShieldSlotList ) - { - removeStatusEffect( slotId, false ); - } - sendStatusEffectUpdate(); - } - else - sendEffectResultToUpdateShieldValue(); // yes this is the packet to update shield value - } + sendEffectResultToUpdateShieldValue(); + return remainingDamage; } diff --git a/src/world/StatusEffect/StatusEffect.cpp b/src/world/StatusEffect/StatusEffect.cpp index feefa2b6..3eb96d9a 100644 --- a/src/world/StatusEffect/StatusEffect.cpp +++ b/src/world/StatusEffect/StatusEffect.cpp @@ -291,7 +291,7 @@ void Sapphire::StatusEffect::StatusEffect::onBeforeActionStart( Sapphire::World: m_effectEntry.effectValue1--; if( m_effectEntry.effectValue1 == 0 ) { - m_markToRemove = true; + markToRemove(); } action->setCastTime( 0 ); } @@ -327,6 +327,11 @@ bool Sapphire::StatusEffect::StatusEffect::isMarkedToRemove() return m_markToRemove; } +void Sapphire::StatusEffect::StatusEffect::markToRemove() +{ + m_markToRemove = true; +} + void Sapphire::StatusEffect::StatusEffect::refresh() { m_value = 0; diff --git a/src/world/StatusEffect/StatusEffect.h b/src/world/StatusEffect/StatusEffect.h index f106b827..2958d686 100644 --- a/src/world/StatusEffect/StatusEffect.h +++ b/src/world/StatusEffect/StatusEffect.h @@ -57,6 +57,8 @@ public: bool isMarkedToRemove(); + void markToRemove(); + void refresh(); void refresh( Sapphire::World::Action::StatusEffectEntry newEntry );