mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core: define CREATURE_FAMILY_NONE to avoid magic numbers in code
This commit is contained in:
@@ -69,10 +69,10 @@ public:
|
||||
}
|
||||
|
||||
CreatureTemplate const* creatureTemplate = creatureTarget->GetCreatureTemplate();
|
||||
// Creatures with family 0 crashes the server
|
||||
// Creatures with family CREATURE_FAMILY_NONE crashes the server
|
||||
if (!creatureTemplate->family)
|
||||
{
|
||||
handler->PSendSysMessage("This creature cannot be tamed. (family id: 0).");
|
||||
handler->PSendSysMessage("This creature cannot be tamed. (family id: CREATURE_FAMILY_NONE).");
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -508,6 +508,8 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
case CREATURE_FAMILY_IMP:
|
||||
targetCreature->CastSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user