mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-11 04:42:26 +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)
|
Raid::Raid(uint32 raidID)
|
||||||
: GroupIDConsumer(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) {
|
for (auto& gm : group_mentor) {
|
||||||
gm.mentor_percent = 0;
|
gm.mentor_percent = 0;
|
||||||
gm.mentoree = nullptr;
|
gm.mentoree = nullptr;
|
||||||
@ -65,8 +63,6 @@ Raid::Raid(uint32 raidID)
|
|||||||
Raid::Raid(Client* nLeader)
|
Raid::Raid(Client* nLeader)
|
||||||
: GroupIDConsumer()
|
: GroupIDConsumer()
|
||||||
{
|
{
|
||||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
|
||||||
for (auto& gm : group_mentor) {
|
for (auto& gm : group_mentor) {
|
||||||
gm.mentor_percent = 0;
|
gm.mentor_percent = 0;
|
||||||
gm.mentoree = nullptr;
|
gm.mentoree = nullptr;
|
||||||
@ -451,13 +447,13 @@ void Raid::SaveRaidLeaderAA()
|
|||||||
void Raid::UpdateGroupAAs(uint32 gid)
|
void Raid::UpdateGroupAAs(uint32 gid)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (gid > MAX_RAID_GROUPS) {
|
if (gid > MAX_RAID_GROUPS || gid == RAID_GROUPLESS || gid < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *gl = GetGroupLeader(gid);
|
Client *gl = GetGroupLeader(gid);
|
||||||
|
|
||||||
if (gl) {
|
if (gl && gl->IsClient()) {
|
||||||
gl->GetGroupAAs(&group_aa[gid]);
|
gl->GetGroupAAs(&group_aa[gid]);
|
||||||
} else {
|
} else {
|
||||||
memset(&group_aa[gid], 0, sizeof(GroupLeadershipAA_Struct));
|
memset(&group_aa[gid], 0, sizeof(GroupLeadershipAA_Struct));
|
||||||
|
|||||||
@ -292,8 +292,8 @@ protected:
|
|||||||
bool disbandCheck;
|
bool disbandCheck;
|
||||||
bool forceDisband;
|
bool forceDisband;
|
||||||
std::string motd;
|
std::string motd;
|
||||||
RaidLeadershipAA_Struct raid_aa;
|
RaidLeadershipAA_Struct raid_aa{};
|
||||||
GroupLeadershipAA_Struct group_aa[MAX_RAID_GROUPS];
|
GroupLeadershipAA_Struct group_aa[MAX_RAID_GROUPS]{};
|
||||||
|
|
||||||
GroupMentor group_mentor[MAX_RAID_GROUPS];
|
GroupMentor group_mentor[MAX_RAID_GROUPS];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user