Core/Maps: Made instance_template no longer required to create and enter instance maps
Port From (https://github.com/TrinityCore/TrinityCore/commit/b8e52fd90bdab6e720d13e44c64483945e139fa2)
This commit is contained in:
@@ -45,17 +45,17 @@ namespace Game.Maps
|
||||
|
||||
public static bool IsValidMapCoord(uint mapid, float x, float y)
|
||||
{
|
||||
return Global.MapMgr.IsValidMAP(mapid, false) && IsValidMapCoord(x, y);
|
||||
return Global.MapMgr.IsValidMAP(mapid) && IsValidMapCoord(x, y);
|
||||
}
|
||||
|
||||
public static bool IsValidMapCoord(uint mapid, float x, float y, float z)
|
||||
{
|
||||
return Global.MapMgr.IsValidMAP(mapid, false) && IsValidMapCoord(x, y, z);
|
||||
return Global.MapMgr.IsValidMAP(mapid) && IsValidMapCoord(x, y, z);
|
||||
}
|
||||
|
||||
public static bool IsValidMapCoord(uint mapid, float x, float y, float z, float o)
|
||||
{
|
||||
return Global.MapMgr.IsValidMAP(mapid, false) && IsValidMapCoord(x, y, z, o);
|
||||
return Global.MapMgr.IsValidMAP(mapid) && IsValidMapCoord(x, y, z, o);
|
||||
}
|
||||
|
||||
public static bool IsValidMapCoord(uint mapid, Position pos)
|
||||
|
||||
@@ -696,11 +696,6 @@ namespace Game.Maps
|
||||
return GetResetTime();
|
||||
}
|
||||
|
||||
InstanceTemplate GetTemplate()
|
||||
{
|
||||
return Global.ObjectMgr.GetInstanceTemplate(m_mapid);
|
||||
}
|
||||
|
||||
MapRecord GetMapEntry()
|
||||
{
|
||||
return CliDB.MapStorage.LookupByKey(m_mapid);
|
||||
|
||||
@@ -184,12 +184,6 @@ namespace Game.Maps
|
||||
Log.outError(LogFilter.Maps, "CreateInstance: no record for map {0}", GetId());
|
||||
Cypher.Assert(false);
|
||||
}
|
||||
InstanceTemplate iTemplate = Global.ObjectMgr.GetInstanceTemplate(GetId());
|
||||
if (iTemplate == null)
|
||||
{
|
||||
Log.outError(LogFilter.Maps, "CreateInstance: no instance template for map {0}", GetId());
|
||||
Cypher.Assert(false);
|
||||
}
|
||||
|
||||
// some instances only have one difficulty
|
||||
Global.DB2Mgr.GetDownscaledMapDifficultyData(GetId(), ref difficulty);
|
||||
|
||||
@@ -140,10 +140,6 @@ namespace Game.Entities
|
||||
if (!entry.IsDungeon())
|
||||
return EnterState.CanEnter;
|
||||
|
||||
InstanceTemplate instance = Global.ObjectMgr.GetInstanceTemplate(mapid);
|
||||
if (instance == null)
|
||||
return EnterState.CannotEnterUninstancedDungeon;
|
||||
|
||||
Difficulty targetDifficulty = player.GetDifficultyID(entry);
|
||||
// Get the highest available difficulty if current setting is higher than the instance allows
|
||||
MapDifficultyRecord mapDiff = Global.DB2Mgr.GetDownscaledMapDifficultyData(entry.Id, ref targetDifficulty);
|
||||
@@ -254,16 +250,9 @@ namespace Game.Entities
|
||||
return Map.ExistMap(mapid, gx, gy) && Map.ExistVMap(mapid, gx, gy);
|
||||
}
|
||||
|
||||
public bool IsValidMAP(uint mapid, bool startUp)
|
||||
public bool IsValidMAP(uint mapId)
|
||||
{
|
||||
MapRecord mEntry = CliDB.MapStorage.LookupByKey(mapid);
|
||||
|
||||
if (startUp)
|
||||
return mEntry != null;
|
||||
else
|
||||
return mEntry != null && (!mEntry.IsDungeon() || Global.ObjectMgr.GetInstanceTemplate(mapid) != null);
|
||||
|
||||
// TODO: add check for Battlegroundtemplate
|
||||
return CliDB.MapStorage.ContainsKey(mapId);
|
||||
}
|
||||
|
||||
public void UnloadAll()
|
||||
|
||||
Reference in New Issue
Block a user