Core/Instances: Drop allowMount column in instance_template as it is already handled properly by SPELL_ATTR0_OUTDOORS_ONLY
This commit is contained in:
1 parent
5f8f854794
commit
0baf2d1e1e
5 files changed
+6
-21
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
--
|
||||||
|
ALTER TABLE `instance_template` DROP `allowMount`;
|
||||||
@@ -5520,8 +5520,8 @@ void ObjectMgr::LoadInstanceTemplate()
|
|||||||
{
|
{
|
||||||
uint32 oldMSTime = getMSTime();
|
uint32 oldMSTime = getMSTime();
|
||||||
|
|
||||||
// 0 1 2 4
|
// 0 1 2
|
||||||
QueryResult result = WorldDatabase.Query("SELECT map, parent, script, allowMount FROM instance_template");
|
QueryResult result = WorldDatabase.Query("SELECT map, parent, script FROM instance_template");
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
@@ -5543,8 +5543,6 @@ void ObjectMgr::LoadInstanceTemplate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
InstanceTemplate instanceTemplate;
|
InstanceTemplate instanceTemplate;
|
||||||
|
|
||||||
instanceTemplate.AllowMount = fields[3].GetBool();
|
|
||||||
instanceTemplate.Parent = uint32(fields[1].GetUInt16());
|
instanceTemplate.Parent = uint32(fields[1].GetUInt16());
|
||||||
instanceTemplate.ScriptId = sObjectMgr->GetScriptId(fields[2].GetString());
|
instanceTemplate.ScriptId = sObjectMgr->GetScriptId(fields[2].GetString());
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ struct InstanceTemplate
|
|||||||
|
|
||||||
uint32 Parent;
|
uint32 Parent;
|
||||||
uint32 ScriptId;
|
uint32 ScriptId;
|
||||||
bool AllowMount;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::unordered_map<uint16, InstanceTemplate> InstanceTemplateContainer;
|
typedef std::unordered_map<uint16, InstanceTemplate> InstanceTemplateContainer;
|
||||||
|
|||||||
@@ -169,13 +169,14 @@ void WorldSession::HandleMoveWorldportAck()
|
|||||||
// resurrect character at enter into instance where his corpse exist after add to map
|
// resurrect character at enter into instance where his corpse exist after add to map
|
||||||
|
|
||||||
if (mEntry->IsDungeon() && !GetPlayer()->IsAlive())
|
if (mEntry->IsDungeon() && !GetPlayer()->IsAlive())
|
||||||
|
{
|
||||||
if (GetPlayer()->GetCorpseLocation().GetMapId() == mEntry->ID)
|
if (GetPlayer()->GetCorpseLocation().GetMapId() == mEntry->ID)
|
||||||
{
|
{
|
||||||
GetPlayer()->ResurrectPlayer(0.5f, false);
|
GetPlayer()->ResurrectPlayer(0.5f, false);
|
||||||
GetPlayer()->SpawnCorpseBones();
|
GetPlayer()->SpawnCorpseBones();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool allowMount = !mEntry->IsDungeon() || mEntry->IsBattlegroundOrArena();
|
|
||||||
if (mInstance)
|
if (mInstance)
|
||||||
{
|
{
|
||||||
// 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
|
||||||
@@ -195,15 +196,8 @@ void WorldSession::HandleMoveWorldportAck()
|
|||||||
// 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)
|
|
||||||
_player->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
|
||||||
|
|
||||||
// update zone immediately, otherwise leave channel will cause crash in mtmap
|
// update zone immediately, otherwise leave channel will cause crash in mtmap
|
||||||
uint32 newzone, newarea;
|
uint32 newzone, newarea;
|
||||||
GetPlayer()->GetZoneAndAreaId(newzone, newarea);
|
GetPlayer()->GetZoneAndAreaId(newzone, newarea);
|
||||||
|
|||||||
@@ -6412,14 +6412,6 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
|
|||||||
if (unitCaster->IsInWater() && m_spellInfo->HasAura(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
if (unitCaster->IsInWater() && m_spellInfo->HasAura(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
|
||||||
return SPELL_FAILED_ONLY_ABOVEWATER;
|
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->AreaGroupId)
|
|
||||||
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
|
|
||||||
|
|
||||||
if (unitCaster->IsInDisallowedMountForm())
|
if (unitCaster->IsInDisallowedMountForm())
|
||||||
{
|
{
|
||||||
if (mountResult)
|
if (mountResult)
|
||||||
|
|||||||
Reference in new issue
Block a user