From 1fcafbc938fda93c721e2bc268f290c3aa964dde Mon Sep 17 00:00:00 2001 From: XTZGZoReX Date: Thu, 14 Jan 2010 19:20:11 +0100 Subject: * 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 --- src/game/ObjectMgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/game/ObjectMgr.cpp') 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(cInfo)->unit_class = UNIT_CLASS_WARRIOR; + } if(cInfo->dmgschool >= MAX_SPELL_SCHOOL) { -- cgit v1.2.3