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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user