mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +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
|
|
@ -7112,6 +7112,11 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
|
|||
|
||||
if(meleeAttack)
|
||||
addUnitState(UNIT_STAT_MELEE_ATTACKING);
|
||||
|
||||
// set position before any AI calls/assistance
|
||||
if(GetTypeId()==TYPEID_UNIT)
|
||||
((Creature*)this)->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
|
||||
m_attacking = victim;
|
||||
m_attacking->_addAttacker(this);
|
||||
|
||||
|
|
@ -7126,7 +7131,6 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
|
|||
((WorldObject*)this)->SendMessageToSet(&data, true);
|
||||
|
||||
((Creature*)this)->CallAssistance();
|
||||
((Creature*)this)->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
}
|
||||
|
||||
// delay offhand weapon attack to next attack time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue