From 78aee0780a2e151d4195f0bf062fbc6f18b6fd0f Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:06:56 -0400 Subject: [PATCH] [Bug Fix] Fix Group ID 0 in Group::SaveGroupLeaderAA() (#4487) --- zone/groups.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zone/groups.cpp b/zone/groups.cpp index 1e8ee4739..ad6972e2a 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -2117,15 +2117,20 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) void Group::SaveGroupLeaderAA() { - // Stores the Group Leaders Leadership AA data from the Player Profile as a blob in the group_leaders table. - // This is done so that group members not in the same zone as the Leader still have access to this information. + const uint32 group_id = GetID(); - std::string aa((char *) &LeaderAbilities, sizeof(GroupLeadershipAA_Struct)); - auto results = GroupLeadersRepository::UpdateLeadershipAA(database, aa, GetID()); + if (!group_id) { + return; + } - if (!results) { - LogError("Unable to store GroupLeadershipAA for group_id: [{}]", GetID()); - } + // Stores the Group Leaders Leadership AA data from the Player Profile as a blob in the group_leaders table. + // This is done so that group members not in the same zone as the Leader still have access to this information. + + std::string aa((char*) &LeaderAbilities, sizeof(GroupLeadershipAA_Struct)); + + if (!GroupLeadersRepository::UpdateLeadershipAA(database, aa, group_id)) { + LogError("Unable to store GroupLeadershipAA for group_id: [{}]", group_id); + } } void Group::UnMarkNPC(uint16 ID)