From 95bf674866f65d3f15b8405f5105819b3ba289bb Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Sun, 7 May 2023 11:06:46 +0200 Subject: [PATCH 1/7] Fix replay menu control compilation warning, fix player head getting inside the ceiling while ducked --- addons/sourcemod/scripting/gokz-replays/controls.sp | 5 +++-- addons/sourcemod/scripting/gokz-replays/playback.sp | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/gokz-replays/controls.sp b/addons/sourcemod/scripting/gokz-replays/controls.sp index cda7f07d..08d18d38 100644 --- a/addons/sourcemod/scripting/gokz-replays/controls.sp +++ b/addons/sourcemod/scripting/gokz-replays/controls.sp @@ -165,13 +165,13 @@ int MenuHandler_ReplayControls(Menu menu, MenuAction action, int param1, int par { if (!IsValidClient(param1)) { - return; + return 0; } int bot = GetBotFromClient(GetObserverTarget(param1)); if (bot == -1 || controllingPlayer[bot] != param1) { - return; + return 0; } char info[16]; @@ -207,6 +207,7 @@ int MenuHandler_ReplayControls(Menu menu, MenuAction action, int param1, int par delete menu; } } + return 0; } void CancelReplayControls(int client) diff --git a/addons/sourcemod/scripting/gokz-replays/playback.sp b/addons/sourcemod/scripting/gokz-replays/playback.sp index b3f68659..b5ffe928 100644 --- a/addons/sourcemod/scripting/gokz-replays/playback.sp +++ b/addons/sourcemod/scripting/gokz-replays/playback.sp @@ -1005,7 +1005,7 @@ void PlaybackVersion2(int client, int bot, int &buttons, float vel[3], float ang { newButtons |= IN_JUMP; } - if (currentTickData.flags & RP_IN_DUCK || currentTickData.flags & RP_FL_DUCKING) + if (currentTickData.flags & RP_IN_DUCK) { newButtons |= IN_DUCK; } @@ -1206,6 +1206,13 @@ void PlaybackVersion2Post(int client, int bot) { SetEntityFlags(client, entityFlags | FL_INWATER); } + if (currentTickData.flags & RP_FL_DUCKING) + { + SetEntPropFloat(client, Prop_Send, "m_flDuckAmount", 1.0); + SetEntProp(client, Prop_Send, "m_bDucking", false); + SetEntProp(client, Prop_Send, "m_bDucked", true); + SetEntityFlags(client, FL_DUCKING); + } botSpeed[bot] = GetVectorHorizontalLength(currentTickData.velocity); playbackTick[bot]++; From c3045fbe2a684b7e9ef15ac235f7836ca564f8dd Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Tue, 9 May 2023 22:22:55 +0200 Subject: [PATCH 2/7] No longer update memory access for tp angle byte patching --- addons/sourcemod/scripting/gokz-tpanglefix.sp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sourcemod/scripting/gokz-tpanglefix.sp b/addons/sourcemod/scripting/gokz-tpanglefix.sp index 62977958..d9e04342 100644 --- a/addons/sourcemod/scripting/gokz-tpanglefix.sp +++ b/addons/sourcemod/scripting/gokz-tpanglefix.sp @@ -131,7 +131,7 @@ void PatchAngleFix() { if (LoadFromAddress(gA_ViewAnglePatchAddress, NumberType_Int8) == 0) { - StoreToAddress(gA_ViewAnglePatchAddress, 1, NumberType_Int8); + StoreToAddress(gA_ViewAnglePatchAddress, 1, NumberType_Int8, false); } } @@ -139,7 +139,7 @@ void RestoreAngleFix() { if (LoadFromAddress(gA_ViewAnglePatchAddress, NumberType_Int8) == 1) { - StoreToAddress(gA_ViewAnglePatchAddress, 0, NumberType_Int8); + StoreToAddress(gA_ViewAnglePatchAddress, 0, NumberType_Int8, false); } } From c9e4e5cac1fe25ce60c87c98310578c9a713f690 Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Tue, 30 May 2023 01:32:02 +0200 Subject: [PATCH 3/7] Only track jump during movement processing --- addons/sourcemod/scripting/gokz-jumpstats.sp | 5 +++-- .../sourcemod/scripting/gokz-jumpstats/jump_tracking.sp | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/addons/sourcemod/scripting/gokz-jumpstats.sp b/addons/sourcemod/scripting/gokz-jumpstats.sp index 74d92202..9dc8585b 100644 --- a/addons/sourcemod/scripting/gokz-jumpstats.sp +++ b/addons/sourcemod/scripting/gokz-jumpstats.sp @@ -112,9 +112,10 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 return Plugin_Continue; } -public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float vel[3], const float angles[3], int weapon, int subtype, int cmdnum, int tickcount, int seed, const int mouse[2]) +public Action Movement_OnPlayerMovePost(int client) { - OnPlayerRunCmdPost_JumpTracking(client); + Movement_OnPlayerMovePost_JumpTracking(client); + return Plugin_Continue; } public void Movement_OnStartTouchGround(int client) diff --git a/addons/sourcemod/scripting/gokz-jumpstats/jump_tracking.sp b/addons/sourcemod/scripting/gokz-jumpstats/jump_tracking.sp index acd94428..8850786f 100644 --- a/addons/sourcemod/scripting/gokz-jumpstats/jump_tracking.sp +++ b/addons/sourcemod/scripting/gokz-jumpstats/jump_tracking.sp @@ -1425,19 +1425,15 @@ public Action Movement_OnWalkMovePost(int client) return Plugin_Continue; } -public Action Movement_OnPlayerMovePost(int client) -{ - lastMovementProcessedTime[client] = jumpTrackers[client].tickCount; - return Plugin_Continue; -} -public void OnPlayerRunCmdPost_JumpTracking(int client) +public void Movement_OnPlayerMovePost_JumpTracking(int client) { if (!IsValidClient(client) || !IsPlayerAlive(client)) { return; } + lastMovementProcessedTime[client] = jumpTrackers[client].tickCount; // Check for always failstats if (doFailstatAlways[client]) { From 72a061848370c0c46f75d251e69d34d7366a73d9 Mon Sep 17 00:00:00 2001 From: "zer0.k" Date: Tue, 30 May 2023 13:26:47 +0200 Subject: [PATCH 4/7] Add missing client auth check for points update --- addons/sourcemod/scripting/gokz-global.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sourcemod/scripting/gokz-global.sp b/addons/sourcemod/scripting/gokz-global.sp index 79f8b6ab..51242d1c 100644 --- a/addons/sourcemod/scripting/gokz-global.sp +++ b/addons/sourcemod/scripting/gokz-global.sp @@ -374,7 +374,7 @@ public void OnMapEnd() public void GOKZ_OnOptionChanged(int client, const char[] option, any newValue) { if (StrEqual(option, gC_CoreOptionNames[Option_Mode]) - && GlobalAPI_IsInit()) + && GlobalAPI_IsInit() && IsClientAuthorized(client)) { UpdatePoints(client); } From 0fa4cb9d49b4aa5c520730a2172c5cbe01aebfb9 Mon Sep 17 00:00:00 2001 From: Szwagi Date: Fri, 19 Apr 2024 18:36:40 +0100 Subject: [PATCH 5/7] Fix timer +use through player exploit --- addons/sourcemod/scripting/gokz-core/misc.sp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/gokz-core/misc.sp b/addons/sourcemod/scripting/gokz-core/misc.sp index a1178803..b4e6e29c 100644 --- a/addons/sourcemod/scripting/gokz-core/misc.sp +++ b/addons/sourcemod/scripting/gokz-core/misc.sp @@ -677,9 +677,9 @@ static int FindUseEntity(int client) float m_vecMins[3]; float m_vecMaxs[3]; float m_vecOrigin[3]; - GetEntPropVector(ent, Prop_Send, "m_vecOrigin", m_vecOrigin); - GetEntPropVector(ent, Prop_Send, "m_vecMins", m_vecMins); - GetEntPropVector(ent, Prop_Send, "m_vecMaxs", m_vecMaxs); + GetEntPropVector(client, Prop_Send, "m_vecOrigin", m_vecOrigin); + GetEntPropVector(client, Prop_Send, "m_vecMins", m_vecMins); + GetEntPropVector(client, Prop_Send, "m_vecMaxs", m_vecMaxs); delta[2] = IntervalDistance(endpos[2], m_vecOrigin[2] + m_vecMins[2], m_vecOrigin[2] + m_vecMaxs[2]); if (GetVectorLength(delta) < 80.0) From 15f768863aed1f538db9399d7c32b893615473fc Mon Sep 17 00:00:00 2001 From: zealain Date: Fri, 19 Apr 2024 23:23:17 +0200 Subject: [PATCH 6/7] Bumped mode versions --- addons/sourcemod/scripting/gokz-mode-kztimer.sp | 2 +- addons/sourcemod/scripting/gokz-mode-simplekz.sp | 2 +- addons/sourcemod/scripting/gokz-mode-vanilla.sp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/gokz-mode-kztimer.sp b/addons/sourcemod/scripting/gokz-mode-kztimer.sp index 272652b1..699d80b8 100644 --- a/addons/sourcemod/scripting/gokz-mode-kztimer.sp +++ b/addons/sourcemod/scripting/gokz-mode-kztimer.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-kztimer.txt" -#define MODE_VERSION 217 +#define MODE_VERSION 218 #define DUCK_SPEED_NORMAL 8.0 #define PRE_VELMOD_MAX 1.104 // Calculated 276/250 #define PERF_SPEED_CAP 380.0 diff --git a/addons/sourcemod/scripting/gokz-mode-simplekz.sp b/addons/sourcemod/scripting/gokz-mode-simplekz.sp index 99d76ac6..023ccca9 100644 --- a/addons/sourcemod/scripting/gokz-mode-simplekz.sp +++ b/addons/sourcemod/scripting/gokz-mode-simplekz.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-simplekz.txt" -#define MODE_VERSION 21 +#define MODE_VERSION 22 #define PS_MAX_REWARD_TURN_RATE 0.703125 // Degrees per tick (90 degrees per second) #define PS_MAX_TURN_RATE_DECREMENT 0.015625 // Degrees per tick (2 degrees per second) #define PS_SPEED_MAX 26.54321 // Units diff --git a/addons/sourcemod/scripting/gokz-mode-vanilla.sp b/addons/sourcemod/scripting/gokz-mode-vanilla.sp index aecc201b..43d4ee27 100644 --- a/addons/sourcemod/scripting/gokz-mode-vanilla.sp +++ b/addons/sourcemod/scripting/gokz-mode-vanilla.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-vanilla.txt" -#define MODE_VERSION 17 +#define MODE_VERSION 18 float gF_ModeCVarValues[MODECVAR_COUNT] = { From aafe33d646903090e7d96423ae695c598d4d890b Mon Sep 17 00:00:00 2001 From: zealain Date: Mon, 15 Jul 2024 20:08:52 +0200 Subject: [PATCH 7/7] Update mode versions --- addons/sourcemod/scripting/gokz-mode-kztimer.sp | 2 +- addons/sourcemod/scripting/gokz-mode-simplekz.sp | 2 +- addons/sourcemod/scripting/gokz-mode-vanilla.sp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/gokz-mode-kztimer.sp b/addons/sourcemod/scripting/gokz-mode-kztimer.sp index 699d80b8..b268540b 100644 --- a/addons/sourcemod/scripting/gokz-mode-kztimer.sp +++ b/addons/sourcemod/scripting/gokz-mode-kztimer.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-kztimer.txt" -#define MODE_VERSION 218 +#define MODE_VERSION 2170 #define DUCK_SPEED_NORMAL 8.0 #define PRE_VELMOD_MAX 1.104 // Calculated 276/250 #define PERF_SPEED_CAP 380.0 diff --git a/addons/sourcemod/scripting/gokz-mode-simplekz.sp b/addons/sourcemod/scripting/gokz-mode-simplekz.sp index 023ccca9..e4db09cf 100644 --- a/addons/sourcemod/scripting/gokz-mode-simplekz.sp +++ b/addons/sourcemod/scripting/gokz-mode-simplekz.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-simplekz.txt" -#define MODE_VERSION 22 +#define MODE_VERSION 210 #define PS_MAX_REWARD_TURN_RATE 0.703125 // Degrees per tick (90 degrees per second) #define PS_MAX_TURN_RATE_DECREMENT 0.015625 // Degrees per tick (2 degrees per second) #define PS_SPEED_MAX 26.54321 // Units diff --git a/addons/sourcemod/scripting/gokz-mode-vanilla.sp b/addons/sourcemod/scripting/gokz-mode-vanilla.sp index 43d4ee27..6fb99fb4 100644 --- a/addons/sourcemod/scripting/gokz-mode-vanilla.sp +++ b/addons/sourcemod/scripting/gokz-mode-vanilla.sp @@ -29,7 +29,7 @@ public Plugin myinfo = #define UPDATER_URL GOKZ_UPDATER_BASE_URL..."gokz-mode-vanilla.txt" -#define MODE_VERSION 18 +#define MODE_VERSION 170 float gF_ModeCVarValues[MODECVAR_COUNT] = {