[8077] Resolve mixed store and use 2 different flags values types in single field.

* Create new monster move field in Creature class and use it in all cases when expected use MONSTER_MOVE_* flags.
* Store and use MOVEMENTFLAG_* values in field in MovementInfo structure of Player class.
* Cleanups and fix related code.

NOTE: DB in creature_addon store values similar MONSTER_MOVE_* flags, scritps also expected set only this flags.
This commit is contained in:
VladimirMangos 2009-06-25 11:03:51 +04:00
parent 00fc1d7593
commit 21a6a26386
24 changed files with 215 additions and 201 deletions

View file

@ -3174,7 +3174,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
{
pet->AttackStop();
pet->GetMotionMaster()->MoveFollow(caster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
pet->SetUnitMovementFlags(MONSTER_MOVE_WALK);
pet->AddMonsterMoveFlag(MONSTER_MOVE_WALK);
}
}
@ -3415,10 +3415,10 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
// Creature specific
if(m_target->GetTypeId() != TYPEID_PLAYER)
((Creature*)m_target)->StopMoving();
m_target->StopMoving();
else
{
((Player*)m_target)->m_movementInfo.flags = 0; // Clear movement flags
((Player*)m_target)->m_movementInfo.SetMovementFlags(MOVEMENTFLAG_NONE);
m_target->SetStandState(UNIT_STAND_STATE_STAND);// in 1.5 client
}
@ -3702,10 +3702,10 @@ void Aura::HandleAuraModRoot(bool apply, bool Real)
m_target->SendMessageToSet(&data, true);
//Clear unit movement flags
((Player*)m_target)->m_movementInfo.flags = 0;
((Player*)m_target)->m_movementInfo.SetMovementFlags(MOVEMENTFLAG_NONE);
}
else
((Creature *)m_target)->StopMoving();
m_target->StopMoving();
}
else
{