From 63f0e42faa98ef0c3776d8c887b991a2555cc8df Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 4 May 2022 23:53:10 +0100 Subject: Allow lowering fps_max in the Left 4 Deads --- src/fixes.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/fixes.c b/src/fixes.c index 0a503f8..d055ba8 100644 --- a/src/fixes.c +++ b/src/fixes.c @@ -68,6 +68,27 @@ static void generalfixes(void) { // a game will want to require demos only (probably not till demos are more // robust anyway... whatever) chflags("developer", CON_HIDDEN | CON_DEVONLY, CON_DEMO); + + // fps_max policy varies a bit between speedgames and their communities! + // in theory we might wanna remove CON_NOTCONN on Portal 1 in a future + // release, but for now people haven't fully talked themselves into it. + struct con_var *v = con_findvar("fps_max"); + if (GAMETYPE_MATCHES(L4Dx)) { + // for L4D games, generally changing anything above normal limits is + // banned, but externally capping FPS will always be possible so we + // might as well allow lowering it ingame for convenience. + if (v->parent->base.flags & (CON_HIDDEN | CON_DEVONLY)) { + v->parent->base.flags &= ~(CON_HIDDEN | CON_DEVONLY); + v->parent->hasmax = true; v->parent->maxval = 300; + } + else { + // in TLS, this was made changeable, but still limit to 1000 to + // prevent breaking the engine + v->parent->hasmax = true; v->parent->maxval = 1000; + } + // also show the lower limit in help. engine should enforce anyway + v->parent->hasmin = true; v->parent->minval = 30; + } } static void l4d2specific(void) { -- cgit v1.2.3