Core/Calendar: Fix issue with invite status being set to the wrong invite

Consider the case of Player A inviting Player B to a Calendar Event. After Player B clicks on Accepts/Tentative/Reject, the calendar shows that status for Player A instead.

(cherry picked from commit 7f3d8c99bb14c7b093a5c2419f3e931fef11004e)
This commit is contained in:
jackpoz
2021-12-16 00:15:48 +01:00
committed by Shauren
parent 1b7a1c51ae
commit 71b2f8c6ab
+3 -1
View File
@@ -32,7 +32,9 @@ _status(CALENDAR_STATUS_INVITED), _rank(CALENDAR_RANK_PLAYER), _note("") { }
CalendarInvite::~CalendarInvite()
{
sCalendarMgr->FreeInviteId(_inviteId);
// Free _inviteId only if it's a real invite and not just a pre-invite or guild announcement
if (_inviteId != 0 && _eventId != 0)
sCalendarMgr->FreeInviteId(_inviteId);
}
CalendarEvent::~CalendarEvent()