More animation packet reductions, DoAnim is called in many other places in combat than just AttackAnimation

This commit is contained in:
Akkadius 2017-07-10 20:41:56 -05:00
parent 122e71f4a3
commit 62e4169e50
2 changed files with 7 additions and 3 deletions

View File

@ -55,6 +55,9 @@ extern Zone* zone;
EQEmu::skills::SkillType Mob::AttackAnimation(int Hand, const EQEmu::ItemInstance* weapon, EQEmu::skills::SkillType skillinuse) EQEmu::skills::SkillType Mob::AttackAnimation(int Hand, const EQEmu::ItemInstance* weapon, EQEmu::skills::SkillType skillinuse)
{ {
if (!attack_anim_timer.Check())
return skillinuse;
// Determine animation // Determine animation
int type = 0; int type = 0;
if (weapon && weapon->IsClassCommon()) { if (weapon && weapon->IsClassCommon()) {
@ -137,9 +140,7 @@ EQEmu::skills::SkillType Mob::AttackAnimation(int Hand, const EQEmu::ItemInstanc
if (Hand == EQEmu::inventory::slotSecondary) // DW anim if (Hand == EQEmu::inventory::slotSecondary) // DW anim
type = animDualWield; type = animDualWield;
if (attack_anim_timer.Check()) {
DoAnim(type, 0, false); DoAnim(type, 0, false);
}
return skillinuse; return skillinuse;
} }

View File

@ -1568,6 +1568,9 @@ void Mob::ShowStats(Client* client)
} }
void Mob::DoAnim(const int animnum, int type, bool ackreq, eqFilterType filter) { void Mob::DoAnim(const int animnum, int type, bool ackreq, eqFilterType filter) {
if (!attack_anim_timer.Check())
return;
auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct)); auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct));
Animation_Struct* anim = (Animation_Struct*)outapp->pBuffer; Animation_Struct* anim = (Animation_Struct*)outapp->pBuffer;
anim->spawnid = GetID(); anim->spawnid = GetID();