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:
ModoX
2021-10-23 11:42:47 +02:00
committed by GitHub
parent b6f4b53407
commit 8b171d7c01
5 changed files with 4 additions and 20 deletions

View File

@@ -0,0 +1,2 @@
--
ALTER TABLE `instance_template` DROP `allowMount`;

View File

@@ -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());

View File

@@ -156,7 +156,6 @@ struct InstanceTemplate
{
uint32 Parent;
uint32 ScriptId;
bool AllowMount;
};
typedef std::unordered_map<uint16, InstanceTemplate> InstanceTemplateContainer;

View File

@@ -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);

View File

@@ -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