[10064] Fixed recently show up crash in Unit::StopMoving.

This commit is contained in:
VladimirMangos 2010-06-15 19:12:44 +04:00
parent 5b15cd5dd2
commit 0304448b85
3 changed files with 9 additions and 2 deletions

View file

@ -40,8 +40,11 @@ inline bool isStatic(MovementGenerator *mv)
void
MotionMaster::Initialize()
{
// stop current move
if (!i_owner->IsStopped())
i_owner->StopMoving();
// clear ALL movement generators (including default)
i_owner->StopMoving();
Clear(false,true);
// set new default movement generator

View file

@ -12777,6 +12777,10 @@ void Unit::StopMoving()
{
clearUnitState(UNIT_STAT_MOVING);
// not need send any packets if not in world
if (!IsInWorld())
return;
// send explicit stop packet
// player expected for correct work SPLINEFLAG_WALKMODE
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_NORMAL, GetTypeId() == TYPEID_PLAYER ? SPLINEFLAG_WALKMODE : SPLINEFLAG_NONE, 0);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10063"
#define REVISION_NR "10064"
#endif // __REVISION_NR_H__