mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
refactor(Core/Creature): Remove Inhabit Type (#9272)
This is in reference to issue: https://github.com/azerothcore/azerothcore-wotlk/issues/4361 This is comprised of a cherry pick and partial tc cherry pick:592516ae69dbadb6369c34cfa69efd12de860b4aa22bc236eb
This commit is contained in:
@@ -44,6 +44,11 @@ public:
|
||||
|
||||
virtual void unitSpeedChanged() { }
|
||||
|
||||
// timer in ms
|
||||
virtual void Pause(uint32 /* timer = 0*/) {}
|
||||
// timer in ms
|
||||
virtual void Resume(uint32 /* overrideTimer = 0*/) {}
|
||||
|
||||
// used by Evade code for select point to evade with expected restart default movement
|
||||
virtual bool GetResetPosition(float& /*x*/, float& /*y*/, float& /*z*/) { return false; }
|
||||
};
|
||||
|
||||
@@ -195,18 +195,30 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
|
||||
_currDestPosition.Relocate(finalPoint.x, finalPoint.y, finalPoint.z);
|
||||
|
||||
creature->AddUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
++_moveCount;
|
||||
if (roll_chance_i((int32)_moveCount * 25 + 10))
|
||||
bool walk = true;
|
||||
switch (creature->GetMovementTemplate().GetRandom())
|
||||
{
|
||||
_moveCount = 0;
|
||||
_nextMoveTime.Reset(urand(4000, 8000));
|
||||
case CreatureRandomMovementType::CanRun:
|
||||
walk = creature->IsWalking();
|
||||
break;
|
||||
case CreatureRandomMovementType::AlwaysRun:
|
||||
walk = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Movement::MoveSplineInit init(creature);
|
||||
init.MovebyPath(finalPath);
|
||||
init.SetWalk(true);
|
||||
init.SetWalk(walk);
|
||||
init.Launch();
|
||||
|
||||
++_moveCount;
|
||||
if (roll_chance_i((int32) _moveCount * 25 + 10))
|
||||
{
|
||||
_moveCount = 0;
|
||||
_nextMoveTime.Reset(urand(4000, 8000));
|
||||
}
|
||||
if (sWorld->getBoolConfig(CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS))
|
||||
_preComputedPaths.erase(pathIdx);
|
||||
|
||||
|
||||
@@ -189,7 +189,18 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
|
||||
bool walk = false;
|
||||
if (cOwner && !cOwner->IsPet())
|
||||
{
|
||||
walk = owner->IsWalking();
|
||||
switch (cOwner->GetMovementTemplate().GetChase())
|
||||
{
|
||||
case CreatureChaseMovementType::CanWalk:
|
||||
if (owner->IsWalking())
|
||||
walk = true;
|
||||
break;
|
||||
case CreatureChaseMovementType::AlwaysWalk:
|
||||
walk = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
owner->AddUnitState(UNIT_STATE_CHASE_MOVE);
|
||||
|
||||
Reference in New Issue
Block a user