1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-03 17:27:47 +00:00

stop ticking status if dead

This commit is contained in:
collett 2023-07-24 07:33:09 +09:00
parent 249194630c
commit 0a4bd0dee4

View file

@ -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 );