Core/Vehicle: Change vehicle accessories' phase according to the player on the vehicle
Port From (https://github.com/TrinityCore/TrinityCore/commit/6d5086da1747816e1a4e8518e16ab1923de22e1a)
This commit is contained in:
@@ -521,6 +521,23 @@ namespace Game.Entities
|
||||
{
|
||||
return m_vehicle != null ? m_vehicle.GetBase() : null;
|
||||
}
|
||||
|
||||
Unit GetVehicleRoot()
|
||||
{
|
||||
Unit vehicleRoot = GetVehicleBase();
|
||||
|
||||
if (!vehicleRoot)
|
||||
return null;
|
||||
|
||||
for (; ; )
|
||||
{
|
||||
if (!vehicleRoot.GetVehicleBase())
|
||||
return vehicleRoot;
|
||||
|
||||
vehicleRoot = vehicleRoot.GetVehicleBase();
|
||||
}
|
||||
}
|
||||
|
||||
public Creature GetVehicleCreatureBase()
|
||||
{
|
||||
Unit veh = GetVehicleBase();
|
||||
|
||||
Reference in New Issue
Block a user