Scripts/SmartAI: Some clean-up work:
- NULL -> nullptr - Rename "AssistPlayerInCombat(who)" to "AssistPlayerInCombatAgainst(who)" to reflect what the method actually does - Code style No functionality was changed. (cherry picked from commit 152b3ad5b997f4be06c5bb55ddb15c57a8e28c3b) # Conflicts: # src/server/game/AI/SmartScripts/SmartAI.cpp # src/server/game/AI/SmartScripts/SmartScript.cpp
This commit is contained in:
@@ -63,7 +63,7 @@ void FollowerAI::AttackStart(Unit* who)
|
||||
//This part provides assistance to a player that are attacked by who, even if out of normal aggro range
|
||||
//It will cause me to attack who that are attacking _any_ player (which has been confirmed may happen also on offi)
|
||||
//The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate.
|
||||
bool FollowerAI::AssistPlayerInCombat(Unit* who)
|
||||
bool FollowerAI::AssistPlayerInCombatAgainst(Unit* who)
|
||||
{
|
||||
if (!who || !who->GetVictim())
|
||||
return false;
|
||||
@@ -104,7 +104,7 @@ void FollowerAI::MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me))
|
||||
{
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombatAgainst(who))
|
||||
return;
|
||||
|
||||
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
|
||||
Reference in New Issue
Block a user