From c7dc5195f6dedc19d6c60a08f3fd520d321d7265 Mon Sep 17 00:00:00 2001 From: collett Date: Mon, 24 Jul 2023 08:45:39 +0900 Subject: [PATCH] stop dot/hot only instead of all statuses in case of a scripted status still wants to update --- src/world/Actor/Chara.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index a23410f9..33b7a9af 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -355,16 +355,13 @@ bool Sapphire::Entity::Chara::checkAction() void Sapphire::Entity::Chara::update( uint64_t tickCount ) { - if( isAlive() ) + updateStatusEffects(); + + if( std::difftime( static_cast< time_t >( tickCount ), m_lastTickTime ) > 3000 ) { - updateStatusEffects(); + onTick(); - if( std::difftime( static_cast< time_t >( tickCount ), m_lastTickTime ) > 3000 ) - { - onTick(); - - m_lastTickTime = static_cast< time_t >( tickCount ); - } + m_lastTickTime = static_cast< time_t >( tickCount ); } m_lastUpdate = static_cast< time_t >( tickCount ); @@ -1059,7 +1056,7 @@ void Sapphire::Entity::Chara::onTick() } } - if( thisTickDmg != 0 ) + if( thisTickDmg != 0 && isAlive() ) { thisTickDmg = applyShieldProtection( thisTickDmg ); if( thisTickDmg > 0 ) @@ -1068,7 +1065,7 @@ void Sapphire::Entity::Chara::onTick() static_cast< uint8_t >( ActionEffectType::Damage ), thisTickDmg ), true ); } - if( thisTickHeal != 0 ) + if( thisTickHeal != 0 && isAlive() ) { heal( thisTickHeal ); sendToInRangeSet( makeActorControl( getId(), HPFloatingText, 0,