aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-20 12:30:37 +0800
committermegamage <none@none>2009-07-20 12:30:37 +0800
commitffcbd11b2c4f72f9390486081d813bcf54a41179 (patch)
tree1897f9b0984d421a7ed269859f540c065b32a79c /src/game/ObjectMgr.cpp
parent80b7b3c1fc2186d6e4c3f2105fea3928681625d6 (diff)
[8190] Update killing quest objectives base at creature_template KillCredit fields. Author: GriffonHeart
Note: for avoid double counting must be removed C++ scripts and EventAI scripts that do same thing in old way. Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also implement KillCreditN field check at loading. --HG-- branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index b5e8245c676..c531366845f 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -703,6 +703,18 @@ void ObjectMgr::LoadCreatureTemplates()
if (!displayScaleEntry)
sLog.outErrorDb("Creature (Entry: %u) not has any existed display id in DisplayID_A/DisplayID_A2/DisplayID_H/DisplayID_H2", cInfo->Entry);
+ for(int k = 0; k < MAX_KILL_CREDIT; ++k)
+ {
+ if(cInfo->KillCredit[k])
+ {
+ if(!GetCreatureTemplate(cInfo->KillCredit[k]))
+ {
+ sLog.outErrorDb("Creature (Entry: %u) has not existed creature entry in `KillCredit%d` (%u)",cInfo->Entry,k+1,cInfo->KillCredit[k]);
+ const_cast<CreatureInfo*>(cInfo)->KillCredit[k] = 0;
+ }
+ }
+ }
+
if (cInfo->unit_class && ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);