diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index d7f2695b..bf20f0a4 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -173,6 +173,7 @@ char gS_Verification[MAXPLAYERS+1][8]; bool gB_CookiesRetrieved[MAXPLAYERS+1]; float gF_ZoneAiraccelerate[MAXPLAYERS+1]; float gF_ZoneSpeedLimit[MAXPLAYERS+1]; +float gF_ZoneStartSpeedLimit[MAXPLAYERS+1]; int gI_LastPrintedSteamID[MAXPLAYERS+1]; // kz support @@ -2511,7 +2512,18 @@ bool CanStartTimer(int client, int track, bool skipGroundCheck) return true; float cfgMax = GetStyleSettingFloat(style, "maxprestrafe"); - float prestrafe = cfgMax > 0.0 ? cfgMax : StyleMaxPrestrafe(style); + float zoneMax = gF_ZoneStartSpeedLimit[client]; + // float prestrafe = cfgMax > 0.0 ? cfgMax : StyleMaxPrestrafe(style); + float prestrafe; + if (zoneMax > 0.0) { + prestrafe = zoneMax; + } + else if (cfgMax > 0.0) { + prestrafe = cfgMax; + } else { + prestrafe = StyleMaxPrestrafe(style); + } + if (curVel > prestrafe) return false; @@ -2899,7 +2911,10 @@ void SQL_DBConnect() public void Shavit_OnEnterZone(int client, int type, int track, int id, int entity, int data) { - if (type == Zone_Airaccelerate && track == gA_Timers[client].iTimerTrack) + if (type == Zone_Start && track == gA_Timers[client].iTimerTrack) { + gF_ZoneStartSpeedLimit[client] = float(data); + } + else if (type == Zone_Airaccelerate && track == gA_Timers[client].iTimerTrack) { gF_ZoneAiraccelerate[client] = float(data); } @@ -2921,7 +2936,7 @@ public void Shavit_OnLeaveZone(int client, int type, int track, int id, int enti // Probably so very niche that it doesn't matter. if (track != gA_Timers[client].iTimerTrack) return; - if (type != Zone_Airaccelerate && type != Zone_CustomSpeedLimit) + if (type != Zone_Airaccelerate && type != Zone_CustomSpeedLimit && type != Zone_Start) return; UpdateStyleSettings(client); diff --git a/addons/sourcemod/scripting/shavit-misc.sp b/addons/sourcemod/scripting/shavit-misc.sp index 3527c961..ea0571f0 100644 --- a/addons/sourcemod/scripting/shavit-misc.sp +++ b/addons/sourcemod/scripting/shavit-misc.sp @@ -1357,10 +1357,21 @@ public Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float float fLimit = (Shavit_GetStyleSettingFloat(gI_Style[client], "runspeed") + gCV_PrestrafeLimit.FloatValue); float cfgLimit = Shavit_GetStyleSettingFloat(gI_Style[client], "maxprestrafe"); + + int zoneid; + Shavit_InsideZoneGetID(client, Zone_Start, track, zoneid); + float zoneLimit = float(Shavit_GetZoneData(zoneid)); + float maxPrestrafe = StyleMaxPrestrafe(gI_Style[client]); - if (cfgLimit > 0.0) { + if (zoneLimit > 0.0) + { + fLimit = zoneLimit; + } + else if (cfgLimit > 0.0) + { fLimit = cfgLimit; - } else if (fLimit > maxPrestrafe) { + } + else if (fLimit > maxPrestrafe){ fLimit = maxPrestrafe; } @@ -2294,10 +2305,21 @@ public Action Shavit_OnStartPre(int client, int track, bool& skipGroundTimer) float fLimit = (Shavit_GetStyleSettingFloat(gI_Style[client], "runspeed") + gCV_PrestrafeLimit.FloatValue); float cfgLimit = Shavit_GetStyleSettingFloat(gI_Style[client], "maxprestrafe"); + + int zoneid; + Shavit_InsideZoneGetID(client, Zone_Start, track, zoneid); + float zoneLimit = float(Shavit_GetZoneData(zoneid)); + float maxPrestrafe = StyleMaxPrestrafe(gI_Style[client]); - if (cfgLimit > 0.0) { + if (zoneLimit > 0.0) + { + fLimit = zoneLimit; + } + else if (cfgLimit > 0.0) + { fLimit = cfgLimit; - } else if (fLimit > maxPrestrafe) { + } + else if (fLimit > maxPrestrafe){ fLimit = maxPrestrafe; }