From 843491a75c18c5cf7ffbad10cb79103d5f8e3189 Mon Sep 17 00:00:00 2001 From: khang Date: Thu, 27 Feb 2025 10:33:40 -0500 Subject: [PATCH] add option to not reset checkpoints on disconnect --- BunnymodXT/cvars.hpp | 1 + BunnymodXT/modules/HwDLL.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BunnymodXT/cvars.hpp b/BunnymodXT/cvars.hpp index 6c1d0834..96691ba8 100644 --- a/BunnymodXT/cvars.hpp +++ b/BunnymodXT/cvars.hpp @@ -235,6 +235,7 @@ X(bxt_ch_hook_speed, "869") \ X(bxt_ch_checkpoint_with_vel, "1") \ X(bxt_ch_checkpoint_onground_only, "0") \ + X(_bxt_ch_checkpoint_reset_on_disconnect, "1") \ X(bxt_ch_fix_sticky_slide, "0") \ X(bxt_ch_fix_sticky_slide_offset, "0.01") \ X(bxt_ch_noclip_speed, "0") \ diff --git a/BunnymodXT/modules/HwDLL.cpp b/BunnymodXT/modules/HwDLL.cpp index f8d4f231..3dc18e88 100644 --- a/BunnymodXT/modules/HwDLL.cpp +++ b/BunnymodXT/modules/HwDLL.cpp @@ -5810,6 +5810,7 @@ void HwDLL::RegisterCVarsAndCommandsIfNeeded() RegisterCVar(CVars::bxt_allow_keypresses_in_demo); RegisterCVar(CVars::bxt_ch_checkpoint_with_vel); RegisterCVar(CVars::bxt_ch_checkpoint_onground_only); + RegisterCVar(CVars::_bxt_ch_checkpoint_reset_on_disconnect); if (ORIG_R_SetFrustum && scr_fov_value) { @@ -7047,7 +7048,10 @@ HOOK_DEF_0(HwDLL, void, __cdecl, Cbuf_Execute) if (*state != 5 && *state != 4) { executing = false; - ch_checkpoint_is_set = false; + + if (CVars::_bxt_ch_checkpoint_reset_on_disconnect.GetBool()) + ch_checkpoint_is_set = false; + } insideCbuf_Execute = true;