Move the extra appearance packet guard to SetAppearance

This commit is contained in:
Michael Cook (mackal) 2015-05-18 00:04:55 -04:00
parent 79a87fac1d
commit 553b7c9f8c
3 changed files with 7 additions and 12 deletions

View File

@ -2027,6 +2027,8 @@ const int32& Mob::SetMana(int32 amount)
void Mob::SetAppearance(EmuAppearance app, bool iIgnoreSelf) { void Mob::SetAppearance(EmuAppearance app, bool iIgnoreSelf) {
if (_appearance == app)
return;
_appearance = app; _appearance = app;
SendAppearancePacket(AT_Anim, GetAppearanceValue(app), true, iIgnoreSelf); SendAppearancePacket(AT_Anim, GetAppearanceValue(app), true, iIgnoreSelf);
if (this->IsClient() && this->IsAIControlled()) if (this->IsClient() && this->IsAIControlled())

View File

@ -1676,7 +1676,6 @@ void NPC::AI_DoMovement() {
Log.Out(Logs::Detail, Logs::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); Log.Out(Logs::Detail, Logs::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid());
if (cur_wp_pause != 0) { if (cur_wp_pause != 0) {
SetWaypointPause(); SetWaypointPause();
if (GetAppearance() != eaStanding)
SetAppearance(eaStanding, false); SetAppearance(eaStanding, false);
SetMoving(false); SetMoving(false);
if (m_CurrentWayPoint.w >= 0.0) { if (m_CurrentWayPoint.w >= 0.0) {
@ -1728,7 +1727,6 @@ void NPC::AI_DoMovement() {
SetGrid( 0 - GetGrid()); // revert to AI control SetGrid( 0 - GetGrid()); // revert to AI control
Log.Out(Logs::Detail, Logs::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); Log.Out(Logs::Detail, Logs::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid());
if(GetAppearance() != eaStanding)
SetAppearance(eaStanding, false); SetAppearance(eaStanding, false);
CalculateNewWaypoint(); CalculateNewWaypoint();
@ -1817,7 +1815,6 @@ void NPC::AI_SetupNextWaypoint() {
cur_wp = 0; cur_wp = 0;
} }
if (GetAppearance() != eaStanding)
SetAppearance(eaStanding, false); SetAppearance(eaStanding, false);
entity_list.OpenDoorsNear(CastToNPC()); entity_list.OpenDoorsNear(CastToNPC());
@ -1845,10 +1842,7 @@ void Mob::AI_Event_Engaged(Mob* attacker, bool iYellForHelp) {
if (!IsAIControlled()) if (!IsAIControlled())
return; return;
if(GetAppearance() != eaStanding)
{
SetAppearance(eaStanding); SetAppearance(eaStanding);
}
if (iYellForHelp) { if (iYellForHelp) {
if(IsPet()) { if(IsPet()) {

View File

@ -712,7 +712,6 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
// force an update now // force an update now
move_tic_count = RuleI(Zone, NPCPositonUpdateTicCount); move_tic_count = RuleI(Zone, NPCPositonUpdateTicCount);
SendPosUpdate(); SendPosUpdate();
if (GetAppearance() != eaStanding)
SetAppearance(eaStanding, false); SetAppearance(eaStanding, false);
} }
pLastChange = Timer::GetCurrentTime(); pLastChange = Timer::GetCurrentTime();