mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 15:41:30 +00:00
[Performance] Re-use OP_Animation packet (#4621)
This commit is contained in:
parent
bbfed8300c
commit
59f645b5c3
@ -2559,16 +2559,12 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
const uint8 killed_level = GetLevel();
|
const uint8 killed_level = GetLevel();
|
||||||
|
|
||||||
if (GetClass() == Class::LDoNTreasure) { // open chest
|
if (GetClass() == Class::LDoNTreasure) { // open chest
|
||||||
auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct));
|
static EQApplicationPacket p(OP_Animation, sizeof(Animation_Struct));
|
||||||
|
auto a = (Animation_Struct*) p.pBuffer;
|
||||||
auto a = (Animation_Struct*) outapp->pBuffer;
|
|
||||||
|
|
||||||
a->spawnid = GetID();
|
a->spawnid = GetID();
|
||||||
a->action = 0x0F;
|
a->action = 0x0F;
|
||||||
a->speed = 10;
|
a->speed = 10;
|
||||||
|
entity_list.QueueCloseClients(this, &p);
|
||||||
entity_list.QueueCloseClients(this, outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto app = new EQApplicationPacket(OP_Death, sizeof(Death_Struct));
|
auto app = new EQApplicationPacket(OP_Death, sizeof(Death_Struct));
|
||||||
|
|||||||
11
zone/mob.cpp
11
zone/mob.cpp
@ -125,7 +125,7 @@ Mob::Mob(
|
|||||||
tmHidden(-1),
|
tmHidden(-1),
|
||||||
mitigation_ac(0),
|
mitigation_ac(0),
|
||||||
m_specialattacks(eSpecialAttacks::None),
|
m_specialattacks(eSpecialAttacks::None),
|
||||||
attack_anim_timer(500),
|
attack_anim_timer(100),
|
||||||
position_update_melee_push_timer(500),
|
position_update_melee_push_timer(500),
|
||||||
hate_list_cleanup_timer(6000),
|
hate_list_cleanup_timer(6000),
|
||||||
m_scan_close_mobs_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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct));
|
static EQApplicationPacket p(OP_Animation, sizeof(Animation_Struct));
|
||||||
auto *a = (Animation_Struct *) outapp->pBuffer;
|
auto a = (Animation_Struct*) p.pBuffer;
|
||||||
|
|
||||||
a->spawnid = GetID();
|
a->spawnid = GetID();
|
||||||
a->action = animation_id;
|
a->action = animation_id;
|
||||||
a->speed = animation_speed ? animation_speed : 10;
|
a->speed = animation_speed ? animation_speed : 10;
|
||||||
|
|
||||||
entity_list.QueueCloseClients(
|
entity_list.QueueCloseClients(
|
||||||
this, /* Sender */
|
this, /* Sender */
|
||||||
outapp, /* Packet */
|
&p, /* Packet */
|
||||||
false, /* Ignore Sender */
|
false, /* Ignore Sender */
|
||||||
RuleI(Range, Anims),
|
RuleI(Range, Anims),
|
||||||
0, /* Skip this mob */
|
0, /* Skip this mob */
|
||||||
ackreq, /* Packet ACK */
|
ackreq, /* Packet ACK */
|
||||||
filter /* eqFilterType filter */
|
filter /* eqFilterType filter */
|
||||||
);
|
);
|
||||||
|
|
||||||
safe_delete(outapp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mob::ShowBuffs(Client* c) {
|
void Mob::ShowBuffs(Client* c) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user