From f1a6006ee1a170c69a9f4c0505d1c35526e8738d Mon Sep 17 00:00:00 2001 From: Aeadoin <109764533+Aeadoin@users.noreply.github.com> Date: Mon, 16 Jan 2023 16:50:38 -0500 Subject: [PATCH] [Hotfix] Resolve Zone Crashing when grouped with Bots. (#2747) * [Hotfix] Resolve Zone Crashing when grouped with Bots. * Fixed SpawnBotGroupByName as well. * rename variables --- zone/bot.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index c961e37c6..836e642a5 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4216,7 +4216,8 @@ void Bot::LoadAndSpawnAllZonedBots(Client* bot_owner) { std::vector 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 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]) {