diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 280dc734182..48cca2df14b 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2758,7 +2758,6 @@ void ObjectMgr::LoadVehicleAccessories() return; } - do { Field *fields = result->Fetch(); @@ -2782,6 +2781,12 @@ void ObjectMgr::LoadVehicleAccessories() continue; } + if (mSpellClickInfoMap.find(uiEntry) == mSpellClickInfoMap.end()) + { + sLog->outErrorDb("Table `vehicle_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry); + continue; + } + m_VehicleAccessoryMap[uiEntry].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion, uiSummonType, uiSummonTimer)); ++count; @@ -7692,6 +7697,20 @@ void ObjectMgr::LoadNPCSpellClickSpells() } while (result->NextRow()); + // all spellclick data loaded, now we check if there are creatures with NPC_FLAG_SPELLCLICK but with no data + // NOTE: It *CAN* be the other way around: no spellclick flag but with spellclick data, in case of creature-only vehicle accessories + for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i) + { + if (CreatureInfo const* cInfo = GetCreatureTemplate(i)) + { + if ((cInfo->npcflag & UNIT_NPC_FLAG_SPELLCLICK) && mSpellClickInfoMap.find(i) == mSpellClickInfoMap.end()) + { + sLog->outErrorDb("npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", i); + const_cast<CreatureInfo*>(cInfo)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK; + } + } + } + sLog->outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } |