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 7f3d8c99bb)
This commit is contained in:
jackpoz
2019-07-13 12:10:32 +02:00
committed by Shauren
parent 1b7a1c51ae
commit 71b2f8c6ab

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()