diff --git a/zone/attack.cpp b/zone/attack.cpp index 3de17a13c..735c5b97e 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2559,16 +2559,12 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy const uint8 killed_level = GetLevel(); if (GetClass() == Class::LDoNTreasure) { // open chest - auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct)); - - auto a = (Animation_Struct*) outapp->pBuffer; - + static EQApplicationPacket p(OP_Animation, sizeof(Animation_Struct)); + auto a = (Animation_Struct*) p.pBuffer; a->spawnid = GetID(); a->action = 0x0F; a->speed = 10; - - entity_list.QueueCloseClients(this, outapp); - safe_delete(outapp); + entity_list.QueueCloseClients(this, &p); } auto app = new EQApplicationPacket(OP_Death, sizeof(Death_Struct)); diff --git a/zone/mob.cpp b/zone/mob.cpp index 41ed631bb..5dc44c204 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -125,7 +125,7 @@ Mob::Mob( tmHidden(-1), mitigation_ac(0), m_specialattacks(eSpecialAttacks::None), - attack_anim_timer(500), + attack_anim_timer(100), position_update_melee_push_timer(500), hate_list_cleanup_timer(6000), m_scan_close_mobs_timer(6000), @@ -3540,24 +3540,21 @@ void Mob::DoAnim(const int animation_id, int animation_speed, bool ackreq, eqFil return; } - auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct)); - auto *a = (Animation_Struct *) outapp->pBuffer; - + static EQApplicationPacket p(OP_Animation, sizeof(Animation_Struct)); + auto a = (Animation_Struct*) p.pBuffer; a->spawnid = GetID(); a->action = animation_id; a->speed = animation_speed ? animation_speed : 10; entity_list.QueueCloseClients( this, /* Sender */ - outapp, /* Packet */ + &p, /* Packet */ false, /* Ignore Sender */ RuleI(Range, Anims), 0, /* Skip this mob */ ackreq, /* Packet ACK */ filter /* eqFilterType filter */ ); - - safe_delete(outapp); } void Mob::ShowBuffs(Client* c) {