[Charm] Fix to update target windows on charm on/off (#3549)

* [Charm] Fix to update target windows on charm on/off

* Removed accidental change

* Removed magic #

* reformated brace style in function that was modified

* Use better names for clear variables

* Forgot header with name change

* More header name changes
This commit is contained in:
Paul Coene
2023-08-20 16:43:10 -04:00
committed by GitHub
parent 9cbe25f712
commit 4357b8c731
5 changed files with 50 additions and 32 deletions
+17 -15
View File
@@ -1595,7 +1595,7 @@ void EntityList::RefreshClientXTargets(Client *c)
}
void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *app,
bool iSendToSender, Mob *SkipThisMob, bool ackreq, bool HoTT, uint32 ClientVersionBits, bool inspect_buffs)
bool iSendToSender, Mob *SkipThisMob, bool ackreq, bool HoTT, uint32 ClientVersionBits, bool inspect_buffs, bool clear_target_window)
{
auto it = client_list.begin();
while (it != client_list.end()) {
@@ -1611,7 +1611,7 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
TargetsTarget = Target->GetTarget();
bool Send = false;
bool Send = clear_target_window;
if (c == SkipThisMob)
continue;
@@ -1624,22 +1624,23 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
if (Target == sender) {
if (inspect_buffs) { // if inspect_buffs is true we're sending a mob's buffs to those with the LAA
if (c->GetGM() || RuleB(Spells, AlwaysSendTargetsBuffs)) {
Send = true;
Send = !clear_target_window;
} else if (c->IsRaidGrouped()) {
Raid *raid = c->GetRaid();
if (!raid)
continue;
uint32 gid = raid->GetGroup(c);
if (gid > 11 || raid->GroupCount(gid) < 3)
continue;
if (raid->GetLeadershipAA(groupAAInspectBuffs, gid))
Send = true;
if (raid) {
uint32 gid = raid->GetGroup(c);
if (gid < MAX_RAID_GROUPS && raid->GroupCount(gid) >= 3) {
if (raid->GetLeadershipAA(groupAAInspectBuffs, gid))
Send = !clear_target_window;
}
}
} else {
Group *group = c->GetGroup();
if (!group || group->GroupCount() < 3)
continue;
if (group->GetLeadershipAA(groupAAInspectBuffs))
Send = true;
if (group && group->GroupCount() >= 3) {
if (group->GetLeadershipAA(groupAAInspectBuffs)) {
Send = !clear_target_window;
}
}
}
} else {
Send = true;
@@ -1649,8 +1650,9 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
}
}
if (Send && (c->ClientVersionBit() & ClientVersionBits))
if (Send && (c->ClientVersionBit() & ClientVersionBits)) {
c->QueuePacket(app, ackreq);
}
}
}