feat(Core/Unit): New helpers for DynamicFlags (#11230)

* feat(Core/Unit): New helpers for DynamicFlags

* cherry-pick commit (d611925dc7)

Co-Authored-By: Shauren <shauren.trinity@gmail.com>

* oopsie

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Kitzunu 2022-04-01 12:14:29 +02:00 committed by GitHub
parent 45577d30ca
commit 535c7451a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 85 additions and 73 deletions

View file

@ -267,7 +267,7 @@ public:
uint32 factionid = target->GetFaction();
uint32 flag = target->GetUnitFlags();
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
uint32 dyflag = target->GetDynamicFlags();
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
return true;
}
@ -291,7 +291,7 @@ public:
auto pdyflag = dynamicFlagID;
if (!pdyflag)
dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
dyflag = target->GetDynamicFlags();
else
dyflag = *dynamicFlagID;
@ -307,7 +307,7 @@ public:
target->SetFaction(factionid);
target->ReplaceAllUnitFlags(flag);
target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag);
target->ReplaceAllDynamicFlags(dyflag);
return true;
}