From 1fb84fbfa9924a5ec4139f2b6f659a6aae7d1f76 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 24 Aug 2022 18:52:09 +0100 Subject: [PATCH] Adjust voting rule changes again * If `kartvoterulechanges` is set to `Always`, the third option is always the opposite gametype, even if Encore is unlocked - that will now be present on the second option instead. * This is both for consistancy with having Encore inaccessible on your gamedata, and a response to community feedback. * The `kartencore` cvar being turned on will now be reflected in gametype rule changes from Battle to Race. This plugs one last hole in its area of effect for Race tracks. --- src/g_game.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 0b0631f0..a7c25d08 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3457,21 +3457,14 @@ UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype) if (!cv_kartvoterulechanges.value) // never return (gametype|encoremodifier); - if (randmapbuffer[NUMMAPS] > 0 && (encorepossible || cv_kartvoterulechanges.value != 3)) + if (randmapbuffer[NUMMAPS] > 0 && (cv_kartvoterulechanges.value != 3)) // used to be (encorepossible || rule changes != 3) { randmapbuffer[NUMMAPS]--; - if (cv_kartvoterulechanges.value == 3) // always - { - randmapbuffer[NUMMAPS] = 0; // gotta prep this in case it isn't already set - } return (gametype|encoremodifier); } switch (cv_kartvoterulechanges.value) // okay, we're having a gametype change! when's the next one, luv? { - case 3: // always - randmapbuffer[NUMMAPS] = 1; // every other vote (or always if !encorepossible) - break; case 1: // sometimes randmapbuffer[NUMMAPS] = 5; // per "cup" break; @@ -3483,10 +3476,15 @@ UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype) } // Only this response is prefgametype-based. - // Also intentionally does not use encoremodifier! if (prefgametype == GT_MATCH) + { + // Intentionally does not use encoremodifier! + if (cv_kartencore.value) + return (GT_RACE|0x80); return (GT_RACE); - return (GT_MATCH); + } + // This might appear wrong HERE, but the game will display the Encore possibility on the second voting choice instead. + return (GT_MATCH|encoremodifier); } //