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

This commit is contained in:
Quintinon 2022-06-18 13:45:38 -07:00 committed by GitHub
parent b9ceba1b1c
commit 059a4b7568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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));