mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core/Instances: Drop allowMount column in instance_template as it is already handled properly by SPELL_ATTR0_OUTDOORS_ONLY (#27148)
This commit is contained in:
2
sql/updates/world/master/2021_10_23_00_world.sql
Normal file
2
sql/updates/world/master/2021_10_23_00_world.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
--
|
||||
ALTER TABLE `instance_template` DROP `allowMount`;
|
||||
@@ -5850,8 +5850,8 @@ void ObjectMgr::LoadInstanceTemplate()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2 4
|
||||
QueryResult result = WorldDatabase.Query("SELECT map, parent, script, allowMount FROM instance_template");
|
||||
// 0 1 2
|
||||
QueryResult result = WorldDatabase.Query("SELECT map, parent, script FROM instance_template");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -5874,7 +5874,6 @@ void ObjectMgr::LoadInstanceTemplate()
|
||||
|
||||
InstanceTemplate instanceTemplate;
|
||||
|
||||
instanceTemplate.AllowMount = fields[3].GetBool();
|
||||
instanceTemplate.Parent = uint32(fields[1].GetUInt16());
|
||||
instanceTemplate.ScriptId = sObjectMgr->GetScriptId(fields[2].GetString());
|
||||
|
||||
|
||||
@@ -156,7 +156,6 @@ struct InstanceTemplate
|
||||
{
|
||||
uint32 Parent;
|
||||
uint32 ScriptId;
|
||||
bool AllowMount;
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint16, InstanceTemplate> InstanceTemplateContainer;
|
||||
|
||||
@@ -173,7 +173,6 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
}
|
||||
}
|
||||
|
||||
bool allowMount = !mEntry->IsDungeon() || mEntry->IsBattlegroundOrArena();
|
||||
if (mInstance)
|
||||
{
|
||||
// check if this instance has a reset time and send it to player if so
|
||||
@@ -193,15 +192,8 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
// check if instance is valid
|
||||
if (!GetPlayer()->CheckInstanceValidity(false))
|
||||
GetPlayer()->m_InstanceValid = false;
|
||||
|
||||
// instance mounting is handled in InstanceTemplate
|
||||
allowMount = mInstance->AllowMount;
|
||||
}
|
||||
|
||||
// mount allow check
|
||||
if (!allowMount)
|
||||
_player->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||
|
||||
// update zone immediately, otherwise leave channel will cause crash in mtmap
|
||||
uint32 newzone, newarea;
|
||||
GetPlayer()->GetZoneAndAreaId(newzone, newarea);
|
||||
|
||||
@@ -6055,14 +6055,6 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
if (unitCaster->IsInWater() && m_spellInfo->HasAura(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||
return SPELL_FAILED_ONLY_ABOVEWATER;
|
||||
|
||||
// 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 const* it = sObjectMgr->GetInstanceTemplate(unitCaster->GetMapId());
|
||||
if (it)
|
||||
allowMount = it->AllowMount;
|
||||
if (unitCaster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->RequiredAreasID)
|
||||
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
|
||||
|
||||
if (unitCaster->IsInDisallowedMountForm())
|
||||
{
|
||||
SendMountResult(MountResult::Shapeshifted); // mount result gets sent before the cast result
|
||||
|
||||
Reference in New Issue
Block a user