From 0a4bd0dee48f9abfa3dc16c40bc4952631cece4e Mon Sep 17 00:00:00 2001 From: collett Date: Mon, 24 Jul 2023 07:33:09 +0900 Subject: [PATCH] stop ticking status if dead --- src/world/Actor/Chara.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index 45e27b04..a23410f9 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -355,13 +355,16 @@ bool Sapphire::Entity::Chara::checkAction() void Sapphire::Entity::Chara::update( uint64_t tickCount ) { - updateStatusEffects(); - - if( std::difftime( static_cast< time_t >( tickCount ), m_lastTickTime ) > 3000 ) + if( isAlive() ) { - onTick(); + updateStatusEffects(); - m_lastTickTime = static_cast< time_t >( tickCount ); + if( std::difftime( static_cast< time_t >( tickCount ), m_lastTickTime ) > 3000 ) + { + onTick(); + + m_lastTickTime = static_cast< time_t >( tickCount ); + } } m_lastUpdate = static_cast< time_t >( tickCount );