Core/Creatures: Refactor ObjectMgr::ChooseCreatureFlags to allow selecting only 1 flag field
Port From (https://github.com/TrinityCore/TrinityCore/commit/1d9ed7fb4669a7400251fbed0ad10040d0a95956)
This commit is contained in:
@@ -127,29 +127,11 @@ namespace Game
|
|||||||
|
|
||||||
public static void ChooseCreatureFlags(CreatureTemplate cInfo, out ulong npcFlag, out uint unitFlags, out uint unitFlags2, out uint unitFlags3, out uint dynamicFlags, CreatureData data = null)
|
public static void ChooseCreatureFlags(CreatureTemplate cInfo, out ulong npcFlag, out uint unitFlags, out uint unitFlags2, out uint unitFlags3, out uint dynamicFlags, CreatureData data = null)
|
||||||
{
|
{
|
||||||
npcFlag = (ulong)cInfo.Npcflag;
|
npcFlag = data?.npcflag != 0 ? data.npcflag : cInfo.Npcflag;
|
||||||
unitFlags = (uint)cInfo.UnitFlags;
|
unitFlags = data?.unit_flags != 0 ? data.unit_flags : (uint)cInfo.UnitFlags;
|
||||||
unitFlags2 = cInfo.UnitFlags2;
|
unitFlags2 = data?.unit_flags2 != 0 ? data.unit_flags2 : cInfo.UnitFlags2;
|
||||||
unitFlags3 = cInfo.UnitFlags3;
|
unitFlags3 = data?.unit_flags3 != 0 ? data.unit_flags3 : cInfo.UnitFlags3;
|
||||||
dynamicFlags = cInfo.DynamicFlags;
|
dynamicFlags = data?.dynamicflags != 0 ? data.dynamicflags : cInfo.DynamicFlags;
|
||||||
|
|
||||||
if (data != null)
|
|
||||||
{
|
|
||||||
if (data.npcflag != 0)
|
|
||||||
npcFlag = data.npcflag;
|
|
||||||
|
|
||||||
if (data.unit_flags != 0)
|
|
||||||
unitFlags = data.unit_flags;
|
|
||||||
|
|
||||||
if (data.unit_flags2 != 0)
|
|
||||||
unitFlags2 = data.unit_flags2;
|
|
||||||
|
|
||||||
if (data.unit_flags3 != 0)
|
|
||||||
unitFlags3 = data.unit_flags3;
|
|
||||||
|
|
||||||
if (data.dynamicflags != 0)
|
|
||||||
dynamicFlags = data.dynamicflags;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResponseCodes CheckPlayerName(string name, Locale locale, bool create = false)
|
public static ResponseCodes CheckPlayerName(string name, Locale locale, bool create = false)
|
||||||
|
|||||||
Reference in New Issue
Block a user