mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[9176] Add commented check for unit_class == 0.
In fact creature unit class must not be 0, but some creatures (like triggers) have this. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
9901282592
commit
ee26f74796
3 changed files with 13 additions and 3 deletions
|
|
@ -677,7 +677,8 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||
}
|
||||
}
|
||||
|
||||
if (cInfo->unit_class && ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
// use below code for 0-checks for unit_class
|
||||
if (/*!cInfo->unit_class ||*/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);
|
||||
|
||||
if(cInfo->dmgschool >= MAX_SPELL_SCHOOL)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,16 @@ enum Classes
|
|||
(1<<(CLASS_MAGE-1)) |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-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)))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9175"
|
||||
#define REVISION_NR "9176"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue