mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-02-20 18:10:02 +01:00
Add check to make sure there are races available for a class
This commit is contained in:
parent
269deafc84
commit
5f50b6fddc
@ -165,6 +165,13 @@ Player* RandomPlayerbotFactory::CreateRandomBot(WorldSession* session, uint8 cls
|
||||
raceOptions.push_back(race);
|
||||
}
|
||||
}
|
||||
|
||||
if (raceOptions.size() == 0)
|
||||
{
|
||||
LOG_ERROR("playerbots", "No race available for class: {}", cls);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8 race = raceOptions[urand(0, raceOptions.size() - 1)];
|
||||
|
||||
const auto raceAndGender = CombineRaceAndGender(gender, race);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user