mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[7260] Fixed access to uninitilized fields in FleeingMovementGenerator and Creature::IsOutOfThreatArea.
This commit is contained in:
parent
63b8d1f537
commit
09bf9260cb
3 changed files with 20 additions and 9 deletions
|
|
@ -283,15 +283,22 @@ FleeingMovementGenerator<T>::Initialize(T &owner)
|
|||
if(!&owner)
|
||||
return;
|
||||
|
||||
Unit * fright = ObjectAccessor::GetUnit(owner, i_frightGUID);
|
||||
if(!fright)
|
||||
return;
|
||||
|
||||
_Init(owner);
|
||||
owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
i_caster_x = fright->GetPositionX();
|
||||
i_caster_y = fright->GetPositionY();
|
||||
i_caster_z = fright->GetPositionZ();
|
||||
|
||||
if(Unit * fright = ObjectAccessor::GetUnit(owner, i_frightGUID))
|
||||
{
|
||||
i_caster_x = fright->GetPositionX();
|
||||
i_caster_y = fright->GetPositionY();
|
||||
i_caster_z = fright->GetPositionZ();
|
||||
}
|
||||
else
|
||||
{
|
||||
i_caster_x = owner.GetPositionX();
|
||||
i_caster_y = owner.GetPositionY();
|
||||
i_caster_z = owner.GetPositionZ();
|
||||
}
|
||||
|
||||
i_only_forward = true;
|
||||
i_cur_angle = 0.0f;
|
||||
i_last_distance_from_caster = 0.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue