From f66f0a0914d9367c43b38ebb9c18f5b7a0de5a8a Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 19 Nov 2009 03:49:00 +0300 Subject: [PATCH] [8832] Fixed typo in difficulty name --- src/game/DBCEnums.h | 4 ++-- src/game/Map.h | 4 ++-- src/game/MapManager.cpp | 8 +++----- src/game/MiscHandler.cpp | 10 ++++------ src/shared/revision_nr.h | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 2e28ff0e6..229ebd004 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -234,7 +234,7 @@ enum AreaFlags enum Difficulty { - REGULAR_DEFAULT = 0, + REGULAR_DIFFICULTY = 0, DUNGEON_DIFFICULTY_NORMAL = 0, DUNGEON_DIFFICULTY_HEROIC = 1, @@ -251,7 +251,7 @@ enum Difficulty enum SpawnMask { - SPAWNMASK_REGULAR = (1 << REGULAR_DEFAULT), // any any maps without spawn modes (continents/subway) or in minimal spawnmode + SPAWNMASK_REGULAR = (1 << REGULAR_DIFFICULTY),// any any maps without spawn modes (continents/subway) or in minimal spawnmode SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL), SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC), diff --git a/src/game/Map.h b/src/game/Map.h index d824d22d7..d63cb51ab 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -371,7 +371,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj // regular difficulty = continent/dungeon normal/first raid normal difficulty uint8 GetSpawnMode() const { return (i_spawnMode); } Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); } - bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DEFAULT; } + bool IsRegularDifficulty() const { return GetDifficulty() == REGULAR_DIFFICULTY; } uint32 GetMaxPlayers() const; // dependent from map difficulty uint32 GetMaxResetDelay() const; // dependent from map difficulty MapDifficulty const* GetMapDifficulty() const; // dependent from map difficulty @@ -380,7 +380,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager, public MaNGOS::Obj // NOTE: this duplicate of Instanceable(), but Instanceable() can be changed when BG also will be instanceable bool IsDungeon() const { return i_mapEntry && i_mapEntry->IsDungeon(); } bool IsRaid() const { return i_mapEntry && i_mapEntry->IsRaid(); } - bool IsRaidOrHeroicDungeon() const { return IsRaid() || i_spawnMode > DUNGEON_DIFFICULTY_NORMAL; } + bool IsRaidOrHeroicDungeon() const { return IsRaid() || GetDifficulty() > DUNGEON_DIFFICULTY_NORMAL; } bool IsBattleGround() const { return i_mapEntry && i_mapEntry->IsBattleGround(); } bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); } bool IsBattleGroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattleGroundOrArena(); } diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index 8059c59d4..94055bfb5 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -118,7 +118,7 @@ MapManager::_createBaseMap(uint32 id) } else { - m = new Map(id, i_gridCleanUpDelay, 0, DUNGEON_DIFFICULTY_NORMAL); + m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); } i_maps[id] = m; } @@ -184,13 +184,11 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID,player->GetDifficulty(entry->map_type == MAP_RAID)); if (!mapDiff) { - bool isNormalTargetMap = entry->map_type == MAP_RAID - ? (player->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) - : (player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL); + bool isRegularTargetMap = player->GetDifficulty(entry->IsRaid()) == REGULAR_DIFFICULTY; //Send aborted message // FIX ME: what about absent normal/heroic mode with specific players limit... - player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); + player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); return false; } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index f21a0bcee..fa882341a 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -810,12 +810,10 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if(!mapEntry) return; - bool isNormalTargetMap = mapEntry->IsRaid() - ? (GetPlayer()->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) - : (GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL); + bool isRegularTargetMap = GetPlayer()->GetDifficulty(mapEntry->IsRaid()) == REGULAR_DIFFICULTY; uint32 missingKey = 0; - if (!isNormalTargetMap) + if (!isRegularTargetMap) { if(at->heroicKey) { @@ -828,7 +826,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) } uint32 missingQuest = 0; - if (!isNormalTargetMap) + if (!isRegularTargetMap) { if (at->requiredQuestHeroic && !GetPlayer()->GetQuestRewardStatus(at->requiredQuestHeroic)) missingQuest = at->requiredQuestHeroic; @@ -845,7 +843,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if(missingItem) SendAreaTriggerMessage(GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, ObjectMgr::GetItemPrototype(missingItem)->Name1); else if(missingKey) - GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); + GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); else if(missingQuest) SendAreaTriggerMessage(at->requiredFailedText.c_str()); else if(missingLevel) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 21931b450..550b75e02 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8831" + #define REVISION_NR "8832" #endif // __REVISION_NR_H__