[Bug Fix] Delete NpcType Struct returned by Bot::CreateDefaultNPCTypeStructForBot() when unused (#2267)

This commit is contained in:
Quintinon authored and GitHub committed 2022-06-18 16:45:38 -04:00
1 parent b9ceba1b1c
commit 059a4b7568
1 file changed
+2
+2
View File
@@ -434,6 +434,8 @@ bool BotDatabase::LoadBot(const uint32 bot_id, Bot*& loaded_bot)
defaultNPCTypeStruct->ATK
);
safe_delete(defaultNPCTypeStruct);
loaded_bot = new Bot(bot_id, atoi(row[0]), atoi(row[1]), atof(row[14]), atoi(row[6]), tempNPCStruct);
if (loaded_bot) {
loaded_bot->SetShowHelm((atoi(row[43]) > 0 ? true : false));