feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
parent
54c06eb72e
commit
856aed6fc6
243 changed files with 1205 additions and 1191 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue