Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Author: Chero <3dserver@post.sk> 2011-07-27 18:07:22
- Committer: Chero <3dserver@post.sk> 2011-07-27 18:07:22
- Parent: 73b7ccbd6ec7eae4f140b8f1238ae9bdc05ab9cd (* Corrected target for spell 13982)
- Child: bf421e153f7e3cf8c08d37e734615ec2404064bc (Implement Impossibility to Enter Instance when Encounter is in Progress.)
- Branches: master, remotes/origin/master
- Follows:
- Precedes:
- * Fixed logical bug / exploit, which caused ranged creature using EventAI to stay in place when its target was not in LoS.
- Signed-off-by: Chero <3dserver@post.sk>
- ------------------------- src/game/CreatureEventAI.cpp -------------------------
- index e052e75..7c63989 100644
- @@ -1125,6 +1125,22 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
- if (!m_creature->isAlive())
- return;
- + // Force m_creature to chase to its target when m_creature is ranged and target is not in LoS
- + if (Combat && !m_CombatMovementEnabled)
- + {
- + if (!m_creature->IsWithinLOSInMap(m_creature->getVictim()) && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
- + {
- + m_creature->GetMotionMaster()->Clear(false);
- + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle);
- + }
- + else if (m_creature->IsWithinLOSInMap(m_creature->getVictim()) && m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
- + {
- + m_creature->GetMotionMaster()->Clear(false);
- + m_creature->GetMotionMaster()->MoveIdle();
- + m_creature->StopMoving();
- + }
- + }
- +
- if (!m_bEmptyList)
- {
- //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events
Add Comment
Please, Sign In to add comment