From 0c3c40329dea2a36ffe716dc8d94bc401c3ab642 Mon Sep 17 00:00:00 2001 From: Ayane Satomi Date: Tue, 26 Apr 2022 00:20:07 +0800 Subject: [PATCH] Add more experiments Signed-off-by: Ayane Satomi --- add_state_change_listener_ctp.lua | 17 +++++++++++++++++ remove_playerstepsoundtime_ctp.lua | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 add_state_change_listener_ctp.lua create mode 100644 remove_playerstepsoundtime_ctp.lua diff --git a/add_state_change_listener_ctp.lua b/add_state_change_listener_ctp.lua new file mode 100644 index 0000000..8776fbb --- /dev/null +++ b/add_state_change_listener_ctp.lua @@ -0,0 +1,17 @@ +hook.Add("Think", "CtpCheck", function() + if not ctp or not ctp.Toggle then return end + + function ctp:Toggle() + self = self or ctp + + if ctp:IsEnabled() then + ctp.Disable() + else + ctp.Enable() + end + + hook.Run("OnCtpStateChanged", ctp:IsEnabled()) + end + + hook.Remove("Think", "CtpCheck") +end) \ No newline at end of file diff --git a/remove_playerstepsoundtime_ctp.lua b/remove_playerstepsoundtime_ctp.lua new file mode 100644 index 0000000..8f119fa --- /dev/null +++ b/remove_playerstepsoundtime_ctp.lua @@ -0,0 +1,3 @@ +-- This gets rid of the awful PlayerStepSound calculatuion CTP does +-- Which isn't pretty anyway +function ctp:PlayerStepSoundTime() end \ No newline at end of file