mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
fix(Core): Crashfix. (#14667)
This commit is contained in:
@@ -134,6 +134,11 @@ void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
|
||||
}
|
||||
else // ground
|
||||
{
|
||||
if (!_pathGenerator)
|
||||
_pathGenerator = new PathGenerator(creature);
|
||||
else
|
||||
_pathGenerator->Clear();
|
||||
|
||||
bool result = _pathGenerator->CalculatePath(x, y, levelZ, false);
|
||||
if (result && !(_pathGenerator->GetPathType() & PATHFIND_NOPATH))
|
||||
{
|
||||
@@ -252,8 +257,6 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* creature)
|
||||
}
|
||||
}
|
||||
|
||||
if (!_pathGenerator)
|
||||
_pathGenerator = new PathGenerator(creature);
|
||||
creature->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user