mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Core/Creatures: Update HomePosition upon ExitVehicle only if the creature was inside a vehicle (#29491)
This commit is contained in:
@@ -3387,9 +3387,11 @@ std::string Creature::GetDebugInfo() const
|
||||
|
||||
void Creature::ExitVehicle(Position const* /*exitPosition*/)
|
||||
{
|
||||
bool const isInVehicle = GetVehicle();
|
||||
Unit::ExitVehicle();
|
||||
|
||||
// if the creature exits a vehicle, set it's home position to the
|
||||
// if alive creature exits a vehicle, set it's home position to the
|
||||
// exited position so it won't run away (home) and evade if it's hostile
|
||||
SetHomePosition(GetPosition());
|
||||
if (isInVehicle && IsAlive())
|
||||
SetHomePosition(GetPosition());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user