Only show point limit change when it's actually different

This commit is contained in:
Louis authored and Ashnal committed 2020-02-17 00:53:35 -05:00
1 parent f596bf07d5
commit 8d3a9abda3
1 file changed
+14 -7
+14 -7
View File
@@ -4790,6 +4790,8 @@ void ItemFinder_OnChange(void)
* \sa cv_pointlimit, TimeLimit_OnChange
* \author Graue <graue@oceanbase.org>
*/
static int lastpointlimit;
static void PointLimit_OnChange(void)
{
// Don't allow pointlimit in Single Player/Co-Op/Race!
@@ -4800,15 +4802,20 @@ static void PointLimit_OnChange(void)
return;
}
if (cv_pointlimit.value)
if (cv_pointlimit.value != lastpointlimit)
{
CONS_Printf(M_GetText("Levels will end after %s scores %d point%s.\n"),
G_GametypeHasTeams() ? M_GetText("a team") : M_GetText("someone"),
cv_pointlimit.value,
cv_pointlimit.value > 1 ? "s" : "");
if (cv_pointlimit.value)
{
CONS_Printf(M_GetText("Levels will end after %s scores %d point%s.\n"),
G_GametypeHasTeams() ? M_GetText("a team") : M_GetText("someone"),
cv_pointlimit.value,
cv_pointlimit.value > 1 ? "s" : "");
}
else if (netgame || multiplayer)
CONS_Printf(M_GetText("Point limit disabled\n"));
}
else if (netgame || multiplayer)
CONS_Printf(M_GetText("Point limit disabled\n"));
lastpointlimit = cv_pointlimit.value;
}
static void NumLaps_OnChange(void)