[Hotfix] Resolve Zone Crashing when grouped with Bots. (#2747)

* [Hotfix] Resolve Zone Crashing when grouped with Bots.

* Fixed SpawnBotGroupByName as well.

* rename variables
This commit is contained in:
Aeadoin 2023-01-16 16:50:38 -05:00 committed by GitHub
parent dd40f2a0e6
commit f1a6006ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4216,7 +4216,8 @@ void Bot::LoadAndSpawnAllZonedBots(Client* bot_owner) {
std::vector<int> bot_class_spawned_count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (uint8 class_id = WARRIOR; class_id <= BERSERKER; class_id++) {
bot_class_spawn_limits[class_id - 1] = bot_owner->GetBotSpawnLimit(class_id);
auto bot_class_limit = bot_owner->GetBotSpawnLimit(class_id);
bot_class_spawn_limits.push_back(bot_class_limit);
}
auto* g = bot_owner->GetGroup();
@ -9305,7 +9306,8 @@ void Bot::SpawnBotGroupByName(Client* c, std::string botgroup_name, uint32 leade
std::vector<int> bot_class_spawned_count = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (uint8 class_id = WARRIOR; class_id <= BERSERKER; class_id++) {
bot_class_spawn_limits[class_id - 1] = c->GetBotSpawnLimit(class_id);
auto bot_class_limit = c->GetBotSpawnLimit(class_id);
bot_class_spawn_limits.push_back(bot_class_limit);
}
for (const auto& member_iter : member_list[botgroup_id]) {