Core/WorldStates: Migrate conditions and criteria to new worldstate api
Port From (https://github.com/TrinityCore/TrinityCore/commit/7029b78cab620b861818fab4f94c7810caf109de)
This commit is contained in:
@@ -83,7 +83,7 @@ namespace Game.Conditions
|
||||
break;
|
||||
case ConditionTypes.WorldState:
|
||||
{
|
||||
condMeets = ConditionValue2 == Global.WorldMgr.GetWorldState(ConditionValue1);
|
||||
condMeets = Global.WorldStateMgr.GetValue((int)ConditionValue1, map) == ConditionValue2;
|
||||
break;
|
||||
}
|
||||
case ConditionTypes.RealmAchievement:
|
||||
|
||||
@@ -1668,7 +1668,7 @@ namespace Game
|
||||
}
|
||||
case ConditionTypes.WorldState:
|
||||
{
|
||||
if (Global.WorldMgr.GetWorldState((WorldStates)cond.ConditionValue1) == 0)
|
||||
if (Global.WorldStateMgr.GetWorldStateTemplate((int)cond.ConditionValue1) == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "{0} has non existing world state in value1 ({1}), skipped.", cond.ToString(true), cond.ConditionValue1);
|
||||
return false;
|
||||
@@ -2772,7 +2772,7 @@ namespace Game
|
||||
case WorldStateExpressionValueType.WorldState:
|
||||
{
|
||||
uint worldStateId = buffer.ReadUInt32();
|
||||
value = (int)Global.WorldMgr.GetWorldState(worldStateId);
|
||||
value = Global.WorldStateMgr.GetValue((int)worldStateId, player.GetMap());
|
||||
break;
|
||||
}
|
||||
case WorldStateExpressionValueType.Function:
|
||||
|
||||
Reference in New Issue
Block a user