diff --git a/addons/sourcemod/scripting/shavit-misc.sp b/addons/sourcemod/scripting/shavit-misc.sp index d8b5c82f..c1ba8659 100644 --- a/addons/sourcemod/scripting/shavit-misc.sp +++ b/addons/sourcemod/scripting/shavit-misc.sp @@ -45,8 +45,8 @@ enum CheckpointsCache Float:fCPStamina, bool:bCPDucked, bool:bCPDucking, - Float:fCPDucktime, - bool:bCPDuckButton, + Float:fCPDucktime, // m_flDuckAmount in csgo + Float:fCPDuckSpeed, // m_flDuckSpeed in csgo, doesn't exist in css iCPFlags, any:aCPSnapshot[TIMERSNAPSHOT_SIZE], String:sCPTargetname[32], @@ -1680,10 +1680,8 @@ bool SaveCheckpoint(int client, int index) cpcache[fCPGravity] = GetEntityGravity(target); cpcache[fCPSpeed] = GetEntPropFloat(target, Prop_Send, "m_flLaggedMovementValue"); cpcache[fCPStamina] = (gEV_Type != Engine_TF2)? GetEntPropFloat(target, Prop_Send, "m_flStamina"):0.0; - cpcache[bCPDuckButton] = (GetClientButtons(target) & IN_DUCK) > 0; cpcache[iCPFlags] = GetEntityFlags(target); - // TODO: CS:GO version of this if(gEV_Type == Engine_CSS) { cpcache[bCPDucked] = view_as(GetEntProp(target, Prop_Send, "m_bDucked")); @@ -1691,6 +1689,12 @@ bool SaveCheckpoint(int client, int index) cpcache[fCPDucktime] = GetEntPropFloat(target, Prop_Send, "m_flDucktime"); } + else if(gEV_Type == Engine_CSGO) + { + cpcache[fCPDucktime] = GetEntPropFloat(target, Prop_Send, "m_flDuckAmount"); + cpcache[fCPDuckSpeed] = GetEntPropFloat(target, Prop_Send, "m_flDuckSpeed"); + } + any snapshot[TIMERSNAPSHOT_SIZE]; if(IsFakeClient(target)) @@ -1761,15 +1765,6 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage) return; } - bool bDucking = (GetClientButtons(client) & IN_DUCK) > 0; - - if(cpcache[bCPDuckButton] != bDucking) - { - Shavit_PrintToChat(client, "%T", (bDucking)? "MiscCheckpointsCrouchOff":"MiscCheckpointsCrouchOn", client, gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText]); - - return; - } - bool bInStart = Shavit_InsideZone(client, Zone_Start, -1); if(bInStart) @@ -1811,13 +1806,18 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage) SetEntPropFloat(client, Prop_Send, "m_flStamina", cpcache[fCPStamina]); } - // TODO: CS:GO version of this if(gEV_Type == Engine_CSS) { SetEntProp(client, Prop_Send, "m_bDucked", cpcache[bCPDucked]); SetEntProp(client, Prop_Send, "m_bDucking", cpcache[bCPDucking]); SetEntPropFloat(client, Prop_Send, "m_flDucktime", cpcache[fCPDucktime]); } + + else if(gEV_Type == Engine_CSGO) + { + SetEntPropFloat(client, Prop_Send, "m_flDuckAmount", cpcache[fCPDucktime]); + SetEntPropFloat(client, Prop_Send, "m_flDuckSpeed", cpcache[fCPDuckSpeed]); + } if(!suppressMessage) { diff --git a/addons/sourcemod/translations/shavit-misc.phrases.txt b/addons/sourcemod/translations/shavit-misc.phrases.txt index 89f87a6f..0e431da2 100644 --- a/addons/sourcemod/translations/shavit-misc.phrases.txt +++ b/addons/sourcemod/translations/shavit-misc.phrases.txt @@ -83,16 +83,6 @@ "#format" "{1:d},{2:s},{3:s}" "en" "Checkpoint {1} is {2}empty{3}." } - "MiscCheckpointsCrouchOn" - { - "#format" "{1:s},{2:s}" - "en" "You must {1}duck{2} while teleporting to this checkpoint." - } - "MiscCheckpointsCrouchOff" - { - "#format" "{1:s},{2:s}" - "en" "You must {1}stop ducking{2} while teleporting to this checkpoint." - } // ---------- Menus ---------- // "TeleportMenuTitle" {