Core/Vehicles: add a way to delay the Vehicle despawn Time if its needed.

Port From (https://github.com/TrinityCore/TrinityCore/commit/c7b10d3c5fd082faf6c2835239e340babc3dfc76)
This commit is contained in:
hondacrx
2020-12-31 21:12:59 -05:00
parent f75a110654
commit b769656e13
6 changed files with 72 additions and 2 deletions
+14
View File
@@ -509,6 +509,15 @@ namespace Game.Entities
}
}
public TimeSpan GetDespawnDelay()
{
VehicleTemplate vehicleTemplate = Global.ObjectMgr.GetVehicleTemplate(this);
if (vehicleTemplate != null)
return vehicleTemplate.DespawnDelay;
return TimeSpan.FromMilliseconds(1);
}
public Unit GetBase() { return _me; }
public VehicleRecord GetVehicleInfo() { return _vehicleInfo; }
public uint GetCreatureEntry() { return _creatureEntry; }
@@ -718,4 +727,9 @@ namespace Game.Entities
public sbyte SeatId;
public byte SummonedType;
}
public class VehicleTemplate
{
public TimeSpan DespawnDelay;
}
}