diff --git a/src/Bot/Factory/RandomPlayerbotFactory.cpp b/src/Bot/Factory/RandomPlayerbotFactory.cpp index 908bd389..617e4006 100644 --- a/src/Bot/Factory/RandomPlayerbotFactory.cpp +++ b/src/Bot/Factory/RandomPlayerbotFactory.cpp @@ -9,6 +9,7 @@ #include "ArenaTeamMgr.h" #include "DatabaseEnv.h" #include "PlayerbotAI.h" +#include "RaceMgr.h" #include "ScriptMgr.h" #include "SharedDefines.h" #include "SocialMgr.h" @@ -60,7 +61,7 @@ Player* RandomPlayerbotFactory::CreateRandomBot(WorldSession* session, uint8 cls const bool alliance = static_cast(urand(0, 1)); std::vector raceOptions; - for (uint8 race = RACE_HUMAN; race < MAX_RACES; ++race) + for (uint8 race = RACE_HUMAN; race < sRaceMgr->GetMaxRaces(); ++race) { // skip disabled with config races if ((1 << (race - 1)) & sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK)) diff --git a/src/Bot/RandomPlayerbotMgr.cpp b/src/Bot/RandomPlayerbotMgr.cpp index 62f3c7c6..bc1ffaad 100644 --- a/src/Bot/RandomPlayerbotMgr.cpp +++ b/src/Bot/RandomPlayerbotMgr.cpp @@ -37,6 +37,7 @@ #include "PlayerbotFactory.h" #include "Playerbots.h" #include "Position.h" +#include "RaceMgr.h" #include "Random.h" #include "RandomPlayerbotFactory.h" #include "ServerFacade.h" @@ -1995,7 +1996,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache() } // add all initial position - for (uint32 i = 1; i < MAX_RACES; i++) + for (uint32 i = 1; i < sRaceMgr->GetMaxRaces(); i++) { for (uint32 j = 1; j < MAX_CLASSES; j++) { @@ -2008,7 +2009,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache() for (int32 l = 1; l <= 5; l++) { - if ((1 << (i - 1)) & RACEMASK_ALLIANCE) + if ((1 << (i - 1)) & sRaceMgr->GetAllianceRaceMask()) allianceStarterPerLevelCache[(uint8)l].push_back(pos); else hordeStarterPerLevelCache[(uint8)l].push_back(pos); @@ -3126,7 +3127,7 @@ void RandomPlayerbotMgr::PrintStats() std::map lvlPerRace; std::map lvlPerClass; - for (uint8 race = RACE_HUMAN; race < MAX_RACES; ++race) + for (uint8 race = RACE_HUMAN; race < sRaceMgr->GetMaxRaces(); ++race) { perRace[race] = 0; lvlPerRace[race] = 0; @@ -3273,7 +3274,7 @@ void RandomPlayerbotMgr::PrintStats() } LOG_INFO("playerbots", "Bots race:"); - for (uint8 race = RACE_HUMAN; race < MAX_RACES; ++race) + for (uint8 race = RACE_HUMAN; race < sRaceMgr->GetMaxRaces(); ++race) { if (perRace[race]) { diff --git a/src/Mgr/Travel/TravelMgr.cpp b/src/Mgr/Travel/TravelMgr.cpp index be17e28b..703cca0c 100644 --- a/src/Mgr/Travel/TravelMgr.cpp +++ b/src/Mgr/Travel/TravelMgr.cpp @@ -14,6 +14,7 @@ #include "MapMgr.h" #include "PathGenerator.h" #include "Playerbots.h" +#include "RaceMgr.h" #include "TransportMgr.h" #include "VMapFactory.h" #include "VMapMgr2.h" @@ -3335,7 +3336,7 @@ void TravelMgr::LoadQuestTravelTable() std::ostringstream out; - for (uint8 race = RACE_HUMAN; race < MAX_RACES; race++) + for (uint8 race = RACE_HUMAN; race < sRaceMgr->GetMaxRaces(); race++) { for (uint8 cls = CLASS_WARRIOR; cls < MAX_CLASSES; ++cls) { diff --git a/src/Mgr/Travel/TravelNode.cpp b/src/Mgr/Travel/TravelNode.cpp index bdf9cc95..100fdd15 100644 --- a/src/Mgr/Travel/TravelNode.cpp +++ b/src/Mgr/Travel/TravelNode.cpp @@ -11,6 +11,7 @@ #include "BudgetValues.h" #include "PathGenerator.h" #include "Playerbots.h" +#include "RaceMgr.h" #include "ServerFacade.h" #include "TransportMgr.h" @@ -1660,7 +1661,7 @@ void TravelNodeMap::generateStartNodes() startNames[RACE_GNOME] = "Dwarf and Gnome"; startNames[RACE_TROLL] = "Orc and Troll"; - for (uint32 i = 0; i < MAX_RACES; i++) + for (uint32 i = 0; i < sRaceMgr->GetMaxRaces(); i++) { for (uint32 j = 0; j < MAX_CLASSES; j++) {