Core/Vehicles: Added new field CustomFlags to vehicle_template
Port From (https://github.com/TrinityCore/TrinityCore/commit/00eed485156963cab5caa75b8e36dd7a332a423e)
This commit is contained in:
@@ -389,7 +389,11 @@ namespace Game.Entities
|
||||
|
||||
// only for flyable vehicles
|
||||
if (unit.IsFlying())
|
||||
_me.CastSpell(unit, SharedConst.VehicleSpellParachute, true);
|
||||
{
|
||||
VehicleTemplate vehicleTemplate = Global.ObjectMgr.GetVehicleTemplate(this);
|
||||
if (vehicleTemplate == null || !vehicleTemplate.CustomFlags.HasFlag(VehicleCustomFlags.DontForceParachuteOnExit))
|
||||
_me.CastSpell(unit, SharedConst.VehicleSpellParachute, true);
|
||||
}
|
||||
|
||||
if (_me.IsTypeId(TypeId.Unit) && _me.ToCreature().IsAIEnabled())
|
||||
_me.ToCreature().GetAI().PassengerBoarded(unit, seat.Key, false);
|
||||
@@ -828,10 +832,17 @@ namespace Game.Entities
|
||||
public uint? RideSpellID;
|
||||
}
|
||||
|
||||
public enum VehicleCustomFlags
|
||||
{
|
||||
None = 0x0,
|
||||
DontForceParachuteOnExit = 0x1
|
||||
}
|
||||
|
||||
public class VehicleTemplate
|
||||
{
|
||||
public TimeSpan DespawnDelay;
|
||||
public float? Pitch;
|
||||
public VehicleCustomFlags CustomFlags;
|
||||
}
|
||||
|
||||
public class VehicleSeatAddon
|
||||
|
||||
@@ -11391,8 +11391,8 @@ namespace Game
|
||||
|
||||
_vehicleTemplateStore.Clear();
|
||||
|
||||
// 0 1 2
|
||||
SQLResult result = DB.World.Query("SELECT creatureId, despawnDelayMs, Pitch FROM vehicle_template");
|
||||
// 0 1 2 3
|
||||
SQLResult result = DB.World.Query("SELECT creatureId, despawnDelayMs, Pitch, CustomFlags FROM vehicle_template");
|
||||
if (result.IsEmpty())
|
||||
{
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 vehicle template. DB table `vehicle_template` is empty.");
|
||||
@@ -11418,6 +11418,7 @@ namespace Game
|
||||
|
||||
VehicleTemplate vehicleTemplate = new();
|
||||
vehicleTemplate.DespawnDelay = TimeSpan.FromMilliseconds(result.Read<int>(1));
|
||||
vehicleTemplate.CustomFlags = (VehicleCustomFlags)result.Read<int>(3);
|
||||
|
||||
if (!result.IsNull(2))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user