From 4bc844fe3b153c42530f2a19f8a0018ef49d8c66 Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Tue, 24 Nov 2015 16:25:19 -0800 Subject: [PATCH] Work around for Bot::LoadPetBuffs loading buffs with counters --- zone/bot.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zone/bot.cpp b/zone/bot.cpp index 477581eba..9909c6d5d 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2026,6 +2026,16 @@ void Bot::LoadPetBuffs(SpellBuff_Struct* petBuffs, uint32 botPetSaveId) { petBuffs[buffIndex].spellid = atoi(row[0]); petBuffs[buffIndex].level = atoi(row[1]); petBuffs[buffIndex].duration = atoi(row[2]); + //Work around for loading the counters and setting them back to max. Need entry in DB for saved counters + if(CalculatePoisonCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculatePoisonCounters(petBuffs[buffIndex].spellid); + else if(CalculateDiseaseCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculateDiseaseCounters(petBuffs[buffIndex].spellid); + else if(CalculateCurseCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculateCurseCounters(petBuffs[buffIndex].spellid); + else if(CalculateCorruptionCounters(petBuffs[buffIndex].spellid) > 0) + petBuffs[buffIndex].counters = CalculateCorruptionCounters(petBuffs[buffIndex].spellid); + buffIndex++; } query = StringFormat("DELETE FROM `bot_pet_buffs` WHERE `pets_index` = %u;", botPetSaveId);