Core/Instances: Drop allowMount column in instance_template as it is already handled properly by SPELL_ATTR0_OUTDOORS_ONLY
Port From (https://github.com/TrinityCore/TrinityCore/commit/8b171d7c019f0010ec05af92466261d4be78bfff)
This commit is contained in:
@@ -4993,9 +4993,9 @@ namespace Game
|
|||||||
public void LoadInstanceTemplate()
|
public void LoadInstanceTemplate()
|
||||||
{
|
{
|
||||||
var time = Time.GetMSTime();
|
var time = Time.GetMSTime();
|
||||||
// 0 1 2 4
|
|
||||||
SQLResult result = DB.World.Query("SELECT map, parent, script, allowMount FROM instance_template");
|
|
||||||
|
|
||||||
|
// 0 1 2
|
||||||
|
SQLResult result = DB.World.Query("SELECT map, parent, script FROM instance_template");
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 instance templates. DB table `instance_template` is empty!");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 instance templates. DB table `instance_template` is empty!");
|
||||||
@@ -5014,7 +5014,6 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
var instanceTemplate = new InstanceTemplate();
|
var instanceTemplate = new InstanceTemplate();
|
||||||
instanceTemplate.AllowMount = result.Read<bool>(3);
|
|
||||||
instanceTemplate.Parent = result.Read<uint>(1);
|
instanceTemplate.Parent = result.Read<uint>(1);
|
||||||
instanceTemplate.ScriptId = Global.ObjectMgr.GetScriptId(result.Read<string>(2));
|
instanceTemplate.ScriptId = Global.ObjectMgr.GetScriptId(result.Read<string>(2));
|
||||||
|
|
||||||
|
|||||||
@@ -351,7 +351,6 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allowMount = !mapEntry.IsDungeon() || mapEntry.IsBattlegroundOrArena();
|
|
||||||
if (mInstance != null)
|
if (mInstance != null)
|
||||||
{
|
{
|
||||||
// check if this instance has a reset time and send it to player if so
|
// check if this instance has a reset time and send it to player if so
|
||||||
@@ -373,15 +372,8 @@ namespace Game
|
|||||||
// check if instance is valid
|
// check if instance is valid
|
||||||
if (!GetPlayer().CheckInstanceValidity(false))
|
if (!GetPlayer().CheckInstanceValidity(false))
|
||||||
GetPlayer().m_InstanceValid = false;
|
GetPlayer().m_InstanceValid = false;
|
||||||
|
|
||||||
// instance mounting is handled in InstanceTemplate
|
|
||||||
allowMount = mInstance.AllowMount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// mount allow check
|
|
||||||
if (!allowMount)
|
|
||||||
GetPlayer().RemoveAurasByType(AuraType.Mounted);
|
|
||||||
|
|
||||||
// update zone immediately, otherwise leave channel will cause crash in mtmap
|
// update zone immediately, otherwise leave channel will cause crash in mtmap
|
||||||
uint newzone, newarea;
|
uint newzone, newarea;
|
||||||
GetPlayer().GetZoneAndAreaId(out newzone, out newarea);
|
GetPlayer().GetZoneAndAreaId(out newzone, out newarea);
|
||||||
|
|||||||
@@ -5315,15 +5315,6 @@ namespace Game.Spells
|
|||||||
if (unitCaster.IsInWater() && m_spellInfo.HasAura(AuraType.ModIncreaseMountedFlightSpeed))
|
if (unitCaster.IsInWater() && m_spellInfo.HasAura(AuraType.ModIncreaseMountedFlightSpeed))
|
||||||
return SpellCastResult.OnlyAbovewater;
|
return SpellCastResult.OnlyAbovewater;
|
||||||
|
|
||||||
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
|
|
||||||
bool allowMount = !unitCaster.GetMap().IsDungeon() || unitCaster.GetMap().IsBattlegroundOrArena();
|
|
||||||
InstanceTemplate it = Global.ObjectMgr.GetInstanceTemplate(unitCaster.GetMapId());
|
|
||||||
if (it != null)
|
|
||||||
allowMount = it.AllowMount;
|
|
||||||
|
|
||||||
if (unitCaster.IsTypeId(TypeId.Player) && !allowMount && m_spellInfo.RequiredAreasID == 0)
|
|
||||||
return SpellCastResult.NoMountsAllowed;
|
|
||||||
|
|
||||||
if (unitCaster.IsInDisallowedMountForm())
|
if (unitCaster.IsInDisallowedMountForm())
|
||||||
{
|
{
|
||||||
SendMountResult(MountResult.Shapeshifted); // mount result gets sent before the cast result
|
SendMountResult(MountResult.Shapeshifted); // mount result gets sent before the cast result
|
||||||
|
|||||||
Reference in New Issue
Block a user