From 5452d9670154549d7dbcf5ca4579f04d154f0128 Mon Sep 17 00:00:00 2001 From: BotoX Date: Thu, 28 Nov 2019 15:15:32 +0100 Subject: [PATCH] Fix server crash when unloading CSSFixes --- LagCompensation/scripting/LagCompensation.sp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/LagCompensation/scripting/LagCompensation.sp b/LagCompensation/scripting/LagCompensation.sp index e1d6c82..f20d648 100644 --- a/LagCompensation/scripting/LagCompensation.sp +++ b/LagCompensation/scripting/LagCompensation.sp @@ -21,6 +21,7 @@ public Plugin myinfo = }; bool g_bLateLoad = false; +bool g_bHasCSSFixes = true; // Don't change this. #define MAX_EDICTS 2048 @@ -280,12 +281,21 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max return APLRes_Success; } +public void OnLibraryRemoved(const char[] name) +{ + if(StrEqual(name, "CSSFixes")) + g_bHasCSSFixes = false; +} + public void OnPluginEnd() { g_bCleaningUp = true; - FilterClientEntityMap(g_aaFilterClientEntity, false); - BlockTriggerMoved(g_aBlockTriggerMoved, false); - FilterTriggerTouchPlayers(g_aFilterTriggerTouch, false); + if(g_bHasCSSFixes) + { + FilterClientEntityMap(g_aaFilterClientEntity, false); + BlockTriggerMoved(g_aBlockTriggerMoved, false); + FilterTriggerTouchPlayers(g_aFilterTriggerTouch, false); + } DHookDisableDetour(g_hUTIL_Remove, false, Detour_OnUTIL_Remove);