From 2df4289588e5ddb8001b17f91f224d626eb22bea Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Tue, 24 Oct 2023 18:15:42 -0400 Subject: [PATCH] [Bug Fix] Fix empty InsertMany in bot starting items. (#3653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not checking if the vector is empty before it inserts still inserts when there’s nothing. --- zone/bot.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 633f68becd..d337d0c5d7 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8773,7 +8773,9 @@ void Bot::AddBotStartingItems(uint16 race_id, uint8 class_id) } } - BotInventoriesRepository::InsertMany(content_db, v); + if (!v.empty()) { + BotInventoriesRepository::InsertMany(content_db, v); + } } uint8 Bot::spell_casting_chances[SPELL_TYPE_COUNT][PLAYER_CLASS_COUNT][EQ::constants::STANCE_TYPE_COUNT][cntHSND] = { 0 };