diff options
author | Shauren <shauren.trinity@gmail.com> | 2016-02-02 19:13:04 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-02-02 19:13:04 +0100 |
commit | db0b8bf24e2b8eb87e6aed7b031ebe138717403d (patch) | |
tree | 0bc958e6328df57af2072d412f129163bb536d66 /src/server/game/Conditions/ConditionMgr.cpp | |
parent | 46addc21cda6efa706ee454596b5ccae9b2e69d2 (diff) |
Core/Maps: Changed the way area data is stored in maps, it now uses ID field from AreaTable.dbc instead AreaBit used for exploration marker (and is not unique anymore on top of simply being stupidly confusing)
Note: Extracting maps is required
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index ff08b5ea7e8..ed3ae7cb8e5 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1768,7 +1768,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const } case CONDITION_SOURCE_TYPE_PHASE: { - if (cond->SourceEntry && !GetAreaEntryByAreaID(cond->SourceEntry)) + if (cond->SourceEntry && !sAreaTableStore.LookupEntry(cond->SourceEntry)) { TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in AreaTable.dbc, ignoring.", cond->ToString().c_str()); return false; @@ -1845,7 +1845,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const } case CONDITION_ZONEID: { - AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(cond->ConditionValue1); + AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(cond->ConditionValue1); if (!areaEntry) { TC_LOG_ERROR("sql.sql", "%s Area (%u) does not exist, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1); @@ -2592,12 +2592,9 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player* player, PlayerConditionEntry for (std::size_t i = 0; i < ExploredCount::value; ++i) { - if (condition->Explored[i]) - { - int32 exploreFlag = GetAreaFlagByAreaID(condition->Explored[i]); - if (exploreFlag != -1 && !(player->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + exploreFlag / 32) & (1 << (uint32(exploreFlag) % 32)))) + if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(condition->Explored[i])) + if (area->AreaBit != -1 && !(player->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + area->AreaBit / 32) & (1 << (uint32(area->AreaBit) % 32)))) return false; - } } } |