Core/WorldStates: Migrate conditions and criteria to new worldstate api
This commit is contained in:
@@ -2226,7 +2226,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayersRealmWorldState: // 108
|
||||
if (sWorld->getWorldState(reqValue) != secondaryAsset)
|
||||
if (sWorldStateMgr->GetValue(reqValue, referencePlayer->GetMap()) != int32(secondaryAsset))
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TimeBetween: // 109
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "Player.h"
|
||||
#include "RaceMask.h"
|
||||
#include "Realm.h"
|
||||
#include "ReputationMgr.h"
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldStateMgr.h"
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
|
||||
@@ -218,7 +219,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
|
||||
break;
|
||||
case CONDITION_WORLD_STATE:
|
||||
{
|
||||
condMeets = ConditionValue2 == sWorld->getWorldState(ConditionValue1);
|
||||
condMeets = sWorldStateMgr->GetValue(ConditionValue1, map) == int32(ConditionValue2);
|
||||
break;
|
||||
}
|
||||
case CONDITION_REALM_ACHIEVEMENT:
|
||||
@@ -2562,7 +2563,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
}
|
||||
case CONDITION_WORLD_STATE:
|
||||
{
|
||||
if (!sWorld->getWorldState(cond->ConditionValue1))
|
||||
if (!sWorldStateMgr->GetWorldStateTemplate(cond->ConditionValue1))
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "%s has non existing world state in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
|
||||
return false;
|
||||
@@ -3600,7 +3601,7 @@ int32 EvalSingleValue(ByteBuffer& buffer, Player const* player)
|
||||
case WorldStateExpressionValueType::WorldState:
|
||||
{
|
||||
uint32 worldStateId = buffer.read<uint32>();
|
||||
value = sWorld->getWorldState(worldStateId);
|
||||
value = sWorldStateMgr->GetValue(worldStateId, player->GetMap());
|
||||
break;
|
||||
}
|
||||
case WorldStateExpressionValueType::Function:
|
||||
|
||||
@@ -7338,7 +7338,7 @@ void Player::UpdateHostileAreaState(AreaTableEntry const* area)
|
||||
{
|
||||
if (area)
|
||||
{
|
||||
if (InBattleground() || area->Flags[0] & AREA_FLAG_COMBAT || (area->PvpCombatWorldStateID != -1 && sWorld->getWorldState(area->PvpCombatWorldStateID) != 0))
|
||||
if (InBattleground() || area->Flags[0] & AREA_FLAG_COMBAT || (area->PvpCombatWorldStateID != -1 && sWorldStateMgr->GetValue(area->PvpCombatWorldStateID, GetMap()) != 0))
|
||||
pvpInfo.IsInHostileArea = true;
|
||||
else if (IsWarModeLocalActive() || (area->Flags[0] & AREA_FLAG_UNK3))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user