Properly unregister events from the level object
Some checks failed
Build branch / build-all (push) Failing after 18s
CodeQL / Analyze (push) Has been cancelled

Unregister() was mistakenly being called on the DM_Manager object when it should have been called on the level object, to unregister events like axiswin, allieswin, draw
This commit is contained in:
smallmodel 2025-02-20 20:36:19 +01:00
parent a36bbb0cda
commit 512831dea9
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -1415,7 +1415,7 @@ void DM_Manager::EventDoRoundTransition(Event *ev)
// Play the axis victory sound
world->Sound("den_victory_v");
Unregister(STRING_AXISWIN);
level.Unregister(STRING_AXISWIN);
} else if (m_iTeamWin == TEAM_ALLIES) {
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("Allies win!")));
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("Allies win!")));
@ -1423,12 +1423,12 @@ void DM_Manager::EventDoRoundTransition(Event *ev)
// Play the allies victory sound
world->Sound("dfr_victory_v");
Unregister(STRING_ALLIESWIN);
level.Unregister(STRING_ALLIESWIN);
} else {
G_CenterPrintToAllClients(va("\n\n\n%s\n", gi.LV_ConvertString("It's a draw!")));
G_PrintToAllClients(va("%s\n", gi.LV_ConvertString("It's a draw!")));
Unregister(STRING_DRAW);
level.Unregister(STRING_DRAW);
}
G_DisplayScoresToAllClients();