From 06cebecd5005eb60d1ccafbf2bd234201a30635b Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 2 Feb 2011 17:30:18 +0300 Subject: [PATCH] [11100] Avoid send SMSG_DISMOUNT for non aura source mount state. This fix problem with lost mount show at multi-node taxi path. Thanks to blueboy for research problem. --- src/game/MiscHandler.cpp | 2 +- src/game/SpellAuras.cpp | 2 +- src/game/Unit.cpp | 12 ++++++++---- src/game/Unit.h | 2 +- src/shared/revision_nr.h | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 557c6a816..ce3cf8e5c 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1469,7 +1469,7 @@ void WorldSession::HandleCancelMountAuraOpcode( WorldPacket & /*recv_data*/ ) return; } - _player->Unmount(); + _player->Unmount(_player->HasAuraType(SPELL_AURA_MOUNTED)); _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 354231d75..62dfc2094 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2985,7 +2985,7 @@ void Aura::HandleAuraMounted(bool apply, bool Real) } else { - target->Unmount(); + target->Unmount(true); } } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b1f8368dd..4e3b17dd5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7638,7 +7638,7 @@ void Unit::Mount(uint32 mount, uint32 spellId) } } -void Unit::Unmount() +void Unit::Unmount(bool from_aura) { if (!IsMounted()) return; @@ -7648,9 +7648,13 @@ void Unit::Unmount() SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); - WorldPacket data(SMSG_DISMOUNT, 8); - data << GetPackGUID(); - SendMessageToSet(&data, true); + // Called NOT by Taxi system / GM command + if (from_aura) + { + WorldPacket data(SMSG_DISMOUNT, 8); + data << GetPackGUID(); + SendMessageToSet(&data, true); + } // only resummon old pet if the player is already added to a map // this prevents adding a pet to a not created map which would otherwise cause a crash diff --git a/src/game/Unit.h b/src/game/Unit.h index 54716120e..1a9e203f3 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1306,7 +1306,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT ); } uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } void Mount(uint32 mount, uint32 spellId = 0); - void Unmount(); + void Unmount(bool from_aura = false); uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? GetLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index da6bdd9ca..98f12f5af 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11099" + #define REVISION_NR "11100" #endif // __REVISION_NR_H__