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:
hondacrx
2022-01-02 19:54:18 -05:00
parent 418289e41c
commit 9e61335fe8
2 changed files with 30 additions and 1 deletions
+17
View File
@@ -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();