Skip to content

Commit

Permalink
try delaying starting tas playback
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Jul 1, 2023
1 parent d03a60b commit 5a6935f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion BunnymodXT/modules/HwDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4938,7 +4938,7 @@ extern "C" DLLEXPORT void bxt_tas_load_script_from_string(const char *script)
return;
}

hw.StartTASPlayback();
hw.startRunningInputOnNextCbufExecute = true;
}

void HwDLL::SetTASEditorMode(TASEditorMode mode)
Expand Down Expand Up @@ -6297,6 +6297,10 @@ HOOK_DEF_0(HwDLL, void, __cdecl, Cbuf_Execute)
if (*state != 5 && *state != 4)
executing = false;

if (startRunningInputOnNextCbufExecute) {
StartTASPlayback();
}

insideCbuf_Execute = true;
ORIG_Cbuf_Execute(); // executing might change inside if we had some kind of load command in the buffer.

Expand Down
1 change: 1 addition & 0 deletions BunnymodXT/modules/HwDLL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ class HwDLL : public IHookableNameFilterOrdered
std::vector<float> TargetYawOverrides;
float sensitivityToRestore = 0;
public:
bool startRunningInputOnNextCbufExecute = false;
bool ButtonsPresent;
HLTAS::StrafeButtons Buttons;
HLStrafe::CurrentState StrafeState;
Expand Down

0 comments on commit 5a6935f

Please sign in to comment.