mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-08 02:00:29 +00:00
refactor(Core/SharedDefines): Use one class enum instead of two for creatures. (#24918)
This commit is contained in:
@@ -1110,8 +1110,8 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
|
||||
if (!cInfo->unit_class || ((1 << (cInfo->unit_class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) has invalid unit_class ({}) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
|
||||
const_cast<CreatureTemplate*>(cInfo)->unit_class = UNIT_CLASS_WARRIOR;
|
||||
LOG_ERROR("sql.sql", "Creature (Entry: {}) has invalid unit_class ({}) in creature_template. Set to 1 (CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
|
||||
const_cast<CreatureTemplate*>(cInfo)->unit_class = CLASS_WARRIOR;
|
||||
}
|
||||
|
||||
if (cInfo->dmgschool >= MAX_SPELL_SCHOOL)
|
||||
|
||||
@@ -146,15 +146,7 @@ enum Classes
|
||||
(1<<(CLASS_DEATH_KNIGHT-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_ALL_CREATURES ((1<<(CLASS_WARRIOR-1)) | (1<<(CLASS_PALADIN-1)) | (1<<(CLASS_ROGUE-1)) | (1<<(CLASS_MAGE-1)))
|
||||
|
||||
#define CLASSMASK_WAND_USERS ((1<<(CLASS_PRIEST-1))|(1<<(CLASS_MAGE-1))|(1<<(CLASS_WARLOCK-1)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user