aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
authorXTZGZoReX <none@none>2010-01-14 19:20:11 +0100
committerXTZGZoReX <none@none>2010-01-14 19:20:11 +0100
commit1fcafbc938fda93c721e2bc268f290c3aa964dde (patch)
treebb82dcc5f61b7ddd2f0e86f761c6880fcbb16ad5 /src/game/ObjectMgr.cpp
parent9e432b8c4afc77cca7d9cfab02341270e2bdf482 (diff)
* Set creature_template.unit_class to 1 (UNIT_CLASS_WARRIOR) if the value is wrong to prevent issues in CreatureBaseStats::Generate*() functions.
--HG-- branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 36be907cbaa..83fbc7891e7 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -692,7 +692,10 @@ void ObjectMgr::LoadCreatureTemplates()
}
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);
+ {
+ sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
+ const_cast<CreatureInfo*>(cInfo)->unit_class = UNIT_CLASS_WARRIOR;
+ }
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
{