added simple way to disable lag compensation for every round on a map by adding entry into mapchooser cfg

This commit is contained in:
jenz
2026-10-02 11:35:05 +02:00
parent f7995a3656
commit 0a1bf2e910
3 changed files with 31 additions and 1 deletions
@@ -5,6 +5,7 @@
#include <dhooks>
#include <clientprefs>
#include <multicolors>
#include <mapchooser_extended>
#define SetBit(%1,%2) ((%1)[(%2) >> 5] |= (1 << ((%2) & 31)))
#define ClearBit(%1,%2) ((%1)[(%2) >> 5] &= ~(1 << ((%2) & 31)))
@@ -26,6 +27,7 @@ bool g_bLateLoad = false;
bool g_bHasPhysHooks = true;
bool g_bHasOnEntitySpawned = false;
bool g_bCheckPing = false;
bool g_bMapDisabled = false;
int g_iCompenseEntityClass;
// Don't change this.
@@ -434,6 +436,10 @@ void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue
public void OnMapStart()
{
char map[128];
GetCurrentMap(map, sizeof(map));
g_bMapDisabled = GetMapLagCompensationDisabled(map);
bool bLate = g_bLateLoad;
DHookGamerules(g_hEndGameFrame, true);
@@ -728,7 +734,8 @@ bool CheckEntityForLagComp(int entity, const char[] classname, bool bRecursive=f
return false;
// One more than allowed: switch lag compensation off until the next round.
if(g_iNumEntities >= g_iMaxEntities)
//switch lag comp off every round if the map is not allowed to use it
if(g_iNumEntities >= g_iMaxEntities || g_bMapDisabled)
{
SuspendLagCompensation();
return false;