Skip to content

Commit

Permalink
add option to not reset checkpoints on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghugo authored Feb 27, 2025
1 parent bb615f8 commit 053bb41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions BunnymodXT/cvars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") \
Expand Down
5 changes: 4 additions & 1 deletion BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -7047,7 +7048,9 @@ 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;
Expand Down

0 comments on commit 053bb41

Please sign in to comment.