Core/Misc: Move GetContentTuningForArea from ObjectMgr to DB2Manager
Port From (https://github.com/TrinityCore/TrinityCore/commit/8f38c12c4e7d832a91c7719ee1a5ac4d801862a6)
This commit is contained in:
@@ -866,6 +866,24 @@ namespace Game.DataStorage
|
||||
return false;
|
||||
}
|
||||
|
||||
public ContentTuningRecord GetContentTuningForArea(AreaTableRecord areaEntry)
|
||||
{
|
||||
if (areaEntry == null)
|
||||
return null;
|
||||
|
||||
// Get ContentTuning for the area
|
||||
var contentTuning = ContentTuningStorage.LookupByKey(areaEntry.ContentTuningID);
|
||||
if (contentTuning != null)
|
||||
return contentTuning;
|
||||
|
||||
// If there is no data for the current area and it has a parent area, get data from the last (recursive)
|
||||
var parentAreaEntry = AreaTableStorage.LookupByKey(areaEntry.ParentAreaID);
|
||||
if (parentAreaEntry != null)
|
||||
return GetContentTuningForArea(parentAreaEntry);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<ArtifactPowerRecord> GetArtifactPowers(byte artifactId)
|
||||
{
|
||||
return _artifactPowers.LookupByKey(artifactId);
|
||||
|
||||
@@ -2007,7 +2007,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
// Update the correct fishing skill according to the area's ContentTuning
|
||||
ContentTuningRecord areaContentTuning = Global.ObjectMgr.GetContentTuningForArea(areaEntry);
|
||||
ContentTuningRecord areaContentTuning = Global.DB2Mgr.GetContentTuningForArea(areaEntry);
|
||||
if (areaContentTuning == null)
|
||||
break;
|
||||
|
||||
|
||||
@@ -10476,24 +10476,6 @@ namespace Game
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public ContentTuningRecord GetContentTuningForArea(AreaTableRecord areaEntry)
|
||||
{
|
||||
if (areaEntry == null)
|
||||
return null;
|
||||
|
||||
// Get ContentTuning for the area
|
||||
var contentTuning = CliDB.ContentTuningStorage.LookupByKey(areaEntry.ContentTuningID);
|
||||
if (contentTuning != null)
|
||||
return contentTuning;
|
||||
|
||||
// If there is no data for the current area and it has a parent area, get data from the last (recursive)
|
||||
var parentAreaEntry = CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID);
|
||||
if (parentAreaEntry != null)
|
||||
return GetContentTuningForArea(parentAreaEntry);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public uint GetMaxLevelForExpansion(Expansion expansion)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user