* creature_template.unit_class cannot be 0 - added check for this.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-01-14 18:08:42 +01:00
parent 97576c68c4
commit 91ee03d9bf
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -691,7 +691,7 @@ void ObjectMgr::LoadCreatureTemplates()
} }
} }
if (cInfo->unit_class && ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 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); sLog.outErrorDb("Creature (Entry: %u) has invalid unit_class(%u) for creature_template", cInfo->Entry, cInfo->unit_class);
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL) if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
+10 -1
View File
@@ -94,7 +94,16 @@ enum Classes
(1<<(CLASS_MAGE-1)) |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-1)) | \ (1<<(CLASS_MAGE-1)) |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-1)) | \
(1<<(CLASS_DEATH_KNIGHT-1)) ) (1<<(CLASS_DEATH_KNIGHT-1)) )
#define CLASSMASK_ALL_CREATURES ((1<<(CLASS_WARRIOR-1)) | (1<<(CLASS_PALADIN-1)) | (1<<(CLASS_ROGUE-1)) | (1<<(CLASS_MAGE-1)) ) // valid classes for creature_template.unit_class
enum UnitClass
{
UNIT_CLASS_WARRIOR = 1,
UNIT_CLASS_PALADIN = 2,
UNIT_CLASS_ROGUE = 4,
UNIT_CLASS_MAGE = 8,
};
#define CLASSMASK_ALL_CREATURES ((1<<(UNIT_CLASS_WARRIOR-1)) | (1<<(UNIT_CLASS_PALADIN-1)) | (1<<(UNIT_CLASS_ROGUE-1)) | (1<<(UNIT_CLASS_MAGE-1)) )
#define CLASSMASK_WAND_USERS ((1<<(CLASS_PRIEST-1))|(1<<(CLASS_MAGE-1))|(1<<(CLASS_WARLOCK-1))) #define CLASSMASK_WAND_USERS ((1<<(CLASS_PRIEST-1))|(1<<(CLASS_MAGE-1))|(1<<(CLASS_WARLOCK-1)))