From a8eb2832cea05bcb7e77f96f39eacf4ed8aa11d1 Mon Sep 17 00:00:00 2001 From: Aeadoin <109764533+Aeadoin@users.noreply.github.com> Date: Sat, 6 Jan 2024 16:59:35 -0500 Subject: [PATCH] [Crash] Fix crash where Raid invite could be accepted after forming group with the Raid invitor. (#3837) * [Crash] Fix a crash where a raid invite could be accepted affter joining a group with the invitor. * [Crash] Fix a crash where a raid invite could be accepted after joining a group with the invitor. --- zone/client_packet.cpp | 7 +++++++ zone/string_ids.h | 1 + 2 files changed, 8 insertions(+) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index a0a95bcfa..78b8078ee 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -12053,6 +12053,13 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app) { auto player_sending_invite_group = player_sending_invite->GetGroup(); Group* group = GetGroup(); + + /* Prevent scenario where player had joined group with Raid invitor before accepting Raid invite */ + if (group && group == player_sending_invite_group) { + player_sending_invite->MessageString(Chat::Red, INVITE_GROUP_LEADER); + return; + } + if (group) //if our target has a group { raid = new Raid(player_sending_invite); diff --git a/zone/string_ids.h b/zone/string_ids.h index cc09122d8..2adcc6f92 100644 --- a/zone/string_ids.h +++ b/zone/string_ids.h @@ -177,6 +177,7 @@ #define CANNOT_WAKE 555 //%1 tells you, 'I am unable to wake %2, master.' #define SUMMONING_CORPSE_ZONE 596 //Summoning %1's corpse(s). #define TASK_NOT_RIGHT_LEVEL 615 //You are not at the right level for this task. +#define INVITE_GROUP_LEADER 679 //To invite another group into yours, please invite the leader of the other group. #define PET_HOLD_SET_ON 698 //The pet hold mode has been set to on. #define PET_HOLD_SET_OFF 699 //The pet hold mode has been set to off. #define PET_FOCUS_SET_ON 700 //The pet focus mode has been set to on.