[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.
This commit is contained in:
VladimirMangos 2011-02-02 17:30:18 +03:00
parent 6f74fa1be8
commit 06cebecd50
5 changed files with 12 additions and 8 deletions

View file

@ -1469,7 +1469,7 @@ void WorldSession::HandleCancelMountAuraOpcode( WorldPacket & /*recv_data*/ )
return; return;
} }
_player->Unmount(); _player->Unmount(_player->HasAuraType(SPELL_AURA_MOUNTED));
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); _player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
} }

View file

@ -2985,7 +2985,7 @@ void Aura::HandleAuraMounted(bool apply, bool Real)
} }
else else
{ {
target->Unmount(); target->Unmount(true);
} }
} }

View file

@ -7638,7 +7638,7 @@ void Unit::Mount(uint32 mount, uint32 spellId)
} }
} }
void Unit::Unmount() void Unit::Unmount(bool from_aura)
{ {
if (!IsMounted()) if (!IsMounted())
return; return;
@ -7648,9 +7648,13 @@ void Unit::Unmount()
SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT);
WorldPacket data(SMSG_DISMOUNT, 8); // Called NOT by Taxi system / GM command
data << GetPackGUID(); if (from_aura)
SendMessageToSet(&data, true); {
WorldPacket data(SMSG_DISMOUNT, 8);
data << GetPackGUID();
SendMessageToSet(&data, true);
}
// only resummon old pet if the player is already added to a map // 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 // this prevents adding a pet to a not created map which would otherwise cause a crash

View file

@ -1306,7 +1306,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT ); } bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT ); }
uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); }
void Mount(uint32 mount, uint32 spellId = 0); 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; } uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? GetLevelForTarget(target) : getLevel()) * 5; }
void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb); void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11099" #define REVISION_NR "11100"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__