mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Movement: correct logic wrongly ported in 2a84562dc8
I'm referencing line 97 from ChaseMovementGenerator.
That commit introduced a modification in this use case:
- Chasing target is not my current victim, I should stop moving till it is my victim again
Changed To:
- Chasing target is not my current vicitm, I should stop chasing
My correction:
- I dont care about the relation of my current victim and my chasing target, I'm commanded to chase, something will tell me to stop chasing
--> Most likely: evade, new attackstart, etc.
the rest are just minor changes
(cherry picked from commit 9080e7863c)
This commit is contained in:
@@ -66,7 +66,7 @@ inline void MovementGeneratorPointerDeleter(MovementGenerator* a)
|
||||
delete a;
|
||||
}
|
||||
|
||||
void MovementGeneratorDeleter::operator()(MovementGenerator * a)
|
||||
void MovementGeneratorDeleter::operator()(MovementGenerator* a)
|
||||
{
|
||||
MovementGeneratorPointerDeleter(a);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ uint32 MotionMaster::Size() const
|
||||
return _defaultGenerator ? 1 : 0 + uint32(_generators.size());
|
||||
}
|
||||
|
||||
std::vector<MovementGeneratorInformation> MotionMaster::GetMovementGeneratorsInformation() const
|
||||
std::vector<MovementGeneratorInformation> const MotionMaster::GetMovementGeneratorsInformation() const
|
||||
{
|
||||
std::vector<MovementGeneratorInformation> list;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class TC_GAME_API MotionMaster
|
||||
|
||||
bool Empty() const;
|
||||
uint32 Size() const;
|
||||
std::vector<MovementGeneratorInformation> GetMovementGeneratorsInformation() const;
|
||||
std::vector<MovementGeneratorInformation> const GetMovementGeneratorsInformation() const;
|
||||
MovementSlot GetCurrentSlot() const;
|
||||
MovementGenerator* GetCurrentMovementGenerator() const;
|
||||
MovementGeneratorType GetCurrentMovementGeneratorType() const;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "MovementDefines.h"
|
||||
#include "ObjectDefines.h"
|
||||
#include "Position.h"
|
||||
|
||||
@@ -90,11 +90,7 @@ bool ChaseMovementGenerator::Update(Unit* owner, uint32 diff)
|
||||
|
||||
// our target might have gone away
|
||||
Unit* const target = GetTarget();
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
// the owner might've selected a different target (feels like we shouldn't check this here...)
|
||||
if (owner->GetVictim() != target)
|
||||
if (!target || !target->IsInWorld())
|
||||
return false;
|
||||
|
||||
// the owner might be unable to move (rooted or casting), pause movement
|
||||
|
||||
@@ -78,7 +78,7 @@ bool FollowMovementGenerator::Update(Unit* owner, uint32 diff)
|
||||
|
||||
// our target might have gone away
|
||||
Unit* const target = GetTarget();
|
||||
if (!target)
|
||||
if (!target || !target->IsInWorld())
|
||||
return false;
|
||||
|
||||
if (owner->HasUnitState(UNIT_STATE_NOT_MOVE) || owner->IsMovementPreventedByCasting())
|
||||
|
||||
@@ -2199,8 +2199,8 @@ public:
|
||||
float x, y, z;
|
||||
unit->GetMotionMaster()->GetDestination(x, y, z);
|
||||
|
||||
std::vector<MovementGeneratorInformation> list = unit->GetMotionMaster()->GetMovementGeneratorsInformation();
|
||||
for (MovementGeneratorInformation info : list)
|
||||
std::vector<MovementGeneratorInformation> const list = unit->GetMotionMaster()->GetMovementGeneratorsInformation();
|
||||
for (MovementGeneratorInformation const& info : list)
|
||||
{
|
||||
switch (info.Type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user