mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Crash Fix] Raid::UpdateGroupAAs (#4139)
Added checks to potentially resolve a crash situation with raids and group AAs.
This commit is contained in:
parent
79c8858ec8
commit
69c42510ca
@ -40,8 +40,6 @@ extern WorldServer worldserver;
|
||||
Raid::Raid(uint32 raidID)
|
||||
: GroupIDConsumer(raidID)
|
||||
{
|
||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
||||
for (auto& gm : group_mentor) {
|
||||
gm.mentor_percent = 0;
|
||||
gm.mentoree = nullptr;
|
||||
@ -65,8 +63,6 @@ Raid::Raid(uint32 raidID)
|
||||
Raid::Raid(Client* nLeader)
|
||||
: GroupIDConsumer()
|
||||
{
|
||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
||||
for (auto& gm : group_mentor) {
|
||||
gm.mentor_percent = 0;
|
||||
gm.mentoree = nullptr;
|
||||
@ -451,13 +447,13 @@ void Raid::SaveRaidLeaderAA()
|
||||
void Raid::UpdateGroupAAs(uint32 gid)
|
||||
{
|
||||
|
||||
if (gid > MAX_RAID_GROUPS) {
|
||||
if (gid > MAX_RAID_GROUPS || gid == RAID_GROUPLESS || gid < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Client *gl = GetGroupLeader(gid);
|
||||
|
||||
if (gl) {
|
||||
if (gl && gl->IsClient()) {
|
||||
gl->GetGroupAAs(&group_aa[gid]);
|
||||
} else {
|
||||
memset(&group_aa[gid], 0, sizeof(GroupLeadershipAA_Struct));
|
||||
|
||||
@ -292,8 +292,8 @@ protected:
|
||||
bool disbandCheck;
|
||||
bool forceDisband;
|
||||
std::string motd;
|
||||
RaidLeadershipAA_Struct raid_aa;
|
||||
GroupLeadershipAA_Struct group_aa[MAX_RAID_GROUPS];
|
||||
RaidLeadershipAA_Struct raid_aa{};
|
||||
GroupLeadershipAA_Struct group_aa[MAX_RAID_GROUPS]{};
|
||||
|
||||
GroupMentor group_mentor[MAX_RAID_GROUPS];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user