added simple way to disable lag compensation for every round on a map by adding entry into mapchooser cfg
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include <dhooks>
|
#include <dhooks>
|
||||||
#include <clientprefs>
|
#include <clientprefs>
|
||||||
#include <multicolors>
|
#include <multicolors>
|
||||||
|
#include <mapchooser_extended>
|
||||||
|
|
||||||
#define SetBit(%1,%2) ((%1)[(%2) >> 5] |= (1 << ((%2) & 31)))
|
#define SetBit(%1,%2) ((%1)[(%2) >> 5] |= (1 << ((%2) & 31)))
|
||||||
#define ClearBit(%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_bHasPhysHooks = true;
|
||||||
bool g_bHasOnEntitySpawned = false;
|
bool g_bHasOnEntitySpawned = false;
|
||||||
bool g_bCheckPing = false;
|
bool g_bCheckPing = false;
|
||||||
|
bool g_bMapDisabled = false;
|
||||||
int g_iCompenseEntityClass;
|
int g_iCompenseEntityClass;
|
||||||
|
|
||||||
// Don't change this.
|
// Don't change this.
|
||||||
@@ -434,6 +436,10 @@ void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] newValue
|
|||||||
|
|
||||||
public void OnMapStart()
|
public void OnMapStart()
|
||||||
{
|
{
|
||||||
|
char map[128];
|
||||||
|
GetCurrentMap(map, sizeof(map));
|
||||||
|
g_bMapDisabled = GetMapLagCompensationDisabled(map);
|
||||||
|
|
||||||
bool bLate = g_bLateLoad;
|
bool bLate = g_bLateLoad;
|
||||||
|
|
||||||
DHookGamerules(g_hEndGameFrame, true);
|
DHookGamerules(g_hEndGameFrame, true);
|
||||||
@@ -728,7 +734,8 @@ bool CheckEntityForLagComp(int entity, const char[] classname, bool bRecursive=f
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// One more than allowed: switch lag compensation off until the next round.
|
// 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();
|
SuspendLagCompensation();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ native int GetMapLowPopHelpCount(const char[] map);
|
|||||||
native int GetMapLaserFag(const char[] map);
|
native int GetMapLaserFag(const char[] map);
|
||||||
native int GetMapTrails(const char[] map);
|
native int GetMapTrails(const char[] map);
|
||||||
native int GetMapTickRate(const char[] map);
|
native int GetMapTickRate(const char[] map);
|
||||||
|
native int GetMapLagCompensationDisabled(const char[] map);
|
||||||
native int GetMapMinTime(const char[] map);
|
native int GetMapMinTime(const char[] map);
|
||||||
native int GetMapMaxTime(const char[] map);
|
native int GetMapMaxTime(const char[] map);
|
||||||
native int GetMapMinPlayers(const char[] map);
|
native int GetMapMinPlayers(const char[] map);
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
|||||||
CreateNative("GetMapLaserFag", Native_GetMapLaserFag);
|
CreateNative("GetMapLaserFag", Native_GetMapLaserFag);
|
||||||
CreateNative("GetMapTrails", Native_GetMapTrails);
|
CreateNative("GetMapTrails", Native_GetMapTrails);
|
||||||
CreateNative("GetMapTickRate", Native_GetMapTickRate);
|
CreateNative("GetMapTickRate", Native_GetMapTickRate);
|
||||||
|
CreateNative("GetMapLagCompensationDisabled", Native_GetMapLagCompensationDisabled);
|
||||||
CreateNative("GetMapMinTime", Native_GetMapMinTime);
|
CreateNative("GetMapMinTime", Native_GetMapMinTime);
|
||||||
CreateNative("GetMapMaxTime", Native_GetMapMaxTime);
|
CreateNative("GetMapMaxTime", Native_GetMapMaxTime);
|
||||||
CreateNative("GetMapMinPlayers", Native_GetMapMinPlayers);
|
CreateNative("GetMapMinPlayers", Native_GetMapMinPlayers);
|
||||||
@@ -2701,6 +2702,27 @@ public int Native_GetMapCooldownTime2(Handle plugin, int numParams)
|
|||||||
return InternalGetMapCooldownTime2(map);
|
return InternalGetMapCooldownTime2(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//GetMapLagCompensationDisabled
|
||||||
|
public int Native_GetMapLagCompensationDisabled(Handle plugin, int numParams)
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
GetNativeStringLength(1, len);
|
||||||
|
|
||||||
|
if(len <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
char[] map = new char[len+1];
|
||||||
|
GetNativeString(1, map, len+1);
|
||||||
|
int count = 0;
|
||||||
|
|
||||||
|
if (g_Config && g_Config.JumpToKey(map))
|
||||||
|
{
|
||||||
|
count = g_Config.GetNum("DisableLagComp", count);
|
||||||
|
g_Config.Rewind();
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
//GetMapTickRate
|
//GetMapTickRate
|
||||||
public int Native_GetMapTickRate(Handle plugin, int numParams)
|
public int Native_GetMapTickRate(Handle plugin, int numParams)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user