From cd5697bc816a595e9022327db4996029664ca198 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Mon, 3 Apr 2023 17:24:27 -0400 Subject: [PATCH] [Cleanup] Multiple cases same outcome and set skip variable to same value (#3216) # Notes - `skip` is set to `attacker` before it's set to `attacker` again. - Multiple spots in `Mob::AttackAnimation` use the same animations. --- zone/attack.cpp | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index aba017ec5..6a2110389 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -101,30 +101,26 @@ EQ::skills::SkillType Mob::AttackAnimation(int Hand, const EQ::ItemInstance* wea } else if (IsNPC()) { switch (skillinuse) { - case EQ::skills::Skill1HSlashing: // 1H Slashing - type = anim1HWeapon; - break; - case EQ::skills::Skill2HSlashing: // 2H Slashing - type = anim2HSlashing; - break; - case EQ::skills::Skill1HPiercing: // Piercing - type = anim1HPiercing; - break; - case EQ::skills::Skill1HBlunt: // 1H Blunt - type = anim1HWeapon; - break; - case EQ::skills::Skill2HBlunt: // 2H Blunt - type = anim2HSlashing; //anim2HWeapon - break; - case EQ::skills::Skill2HPiercing: // 2H Piercing - type = anim2HWeapon; - break; - case EQ::skills::SkillHandtoHand: - type = animHand2Hand; - break; - default: - type = animHand2Hand; - break; + case EQ::skills::Skill1HBlunt: // 1H Blunt + case EQ::skills::Skill1HSlashing: // 1H Slashing + type = anim1HWeapon; + break; + case EQ::skills::Skill2HBlunt: // 2H Blunt + case EQ::skills::Skill2HSlashing: // 2H Slashing + type = anim2HSlashing; + break; + case EQ::skills::Skill1HPiercing: // Piercing + type = anim1HPiercing; + break; + case EQ::skills::Skill2HPiercing: // 2H Piercing + type = anim2HWeapon; + break; + case EQ::skills::SkillHandtoHand: + type = animHand2Hand; + break; + default: + type = animHand2Hand; + break; }// switch } else { @@ -4305,7 +4301,6 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons attacker->CastToClient()->QueuePacket(outapp, true, CLIENT_CONNECTED, filter); } } - skip = attacker; } //send damage to all clients around except the specified skip mob (attacker or the attacker's owner) and ourself