mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
@@ -265,7 +265,7 @@ public:
|
||||
if (!factionID)
|
||||
{
|
||||
uint32 factionid = target->GetFaction();
|
||||
uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||
uint32 flag = target->GetUnitFlags();
|
||||
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
|
||||
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
|
||||
@@ -273,15 +273,15 @@ public:
|
||||
}
|
||||
|
||||
uint32 factionid = factionID.value();
|
||||
uint32 flag;
|
||||
UnitFlags flag;
|
||||
uint32 npcflag;
|
||||
uint32 dyflag;
|
||||
|
||||
auto pflag = flagID;
|
||||
if (!pflag)
|
||||
flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
|
||||
flag = target->GetUnitFlags();
|
||||
else
|
||||
flag = *pflag;
|
||||
flag = UnitFlags(*pflag);
|
||||
|
||||
auto pnpcflag = npcFlagID;
|
||||
if (!pnpcflag)
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
|
||||
|
||||
target->SetFaction(factionid);
|
||||
target->SetUInt32Value(UNIT_FIELD_FLAGS, flag);
|
||||
target->ReplaceAllUnitFlags(flag);
|
||||
target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
|
||||
target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user