1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 06:47:45 +00:00

Change size() > 0 checks to !empty()

This commit is contained in:
Rushi 2024-06-21 11:31:58 +02:00
parent d8ffb010a3
commit 0ac79362cd

View file

@ -592,14 +592,12 @@ void Action::Action::buildActionResults()
}
// If we hit an enemy
if( m_hitActors.size() > 0 && getHitChara()->getObjKind() != m_pSource->getObjKind() )
if( !m_hitActors.empty() && getHitChara()->getObjKind() != m_pSource->getObjKind() )
{
m_pSource->removeStatusEffectByFlag( Common::StatusEffectFlag::RemoveOnSuccessfulHit );
}
handleJobAction();
if( m_lutEntry.statuses.caster.size() > 0 || m_lutEntry.statuses.target.size() > 0 )
handleStatusEffects();
m_actionResultBuilder->sendActionResults( m_hitActors );
@ -620,7 +618,7 @@ void Action::Action::handleStatusEffects()
return;
// handle caster statuses
if( m_lutEntry.statuses.caster.size() > 0 )
if( !m_lutEntry.statuses.caster.empty() )
{
for( auto& status : m_lutEntry.statuses.caster )
{
@ -629,7 +627,7 @@ void Action::Action::handleStatusEffects()
}
// handle hit actor statuses
if( m_lutEntry.statuses.target.size() > 0 && m_hitActors.size() > 0 )
if( !m_lutEntry.statuses.target.empty() && !m_hitActors.empty() )
{
for( auto& actor : m_hitActors )
{
@ -638,7 +636,7 @@ void Action::Action::handleStatusEffects()
pActionBuilder->applyStatusEffect( actor, status.id, status.duration, 0, std::move( status.modifiers ), status.flag, true );
}
if( actor->getStatusEffectMap().size() > 0 )
if( !actor->getStatusEffectMap().empty() )
actor->onActionHostile( m_pSource );
}
}