@@ -601,8 +601,6 @@ static bool IsTaunting(ClientEnt *player) {
601601}
602602
603603TasFramebulk TasPlayer::SamplePreProcessedFramebulk (int slot, int tasTick, void *player, CUserCmd *cmd) {
604-
605- auto pInfo = GetPlayerInfo (slot, server->GetPlayer (slot + 1 ), cmd);
606604 TasFramebulk& fb = RequestProcessedFramebulkAt (slot, tasTick);
607605
608606 auto fbTick = fb.tick ;
@@ -636,6 +634,8 @@ TasFramebulk TasPlayer::SamplePreProcessedFramebulk(int slot, int tasTick, void
636634 }
637635
638636 if (IsUsingTools ()) {
637+ UpdateTools (slot, fb, PRE_PROCESSING);
638+ auto pInfo = GetPlayerInfo (slot, server->GetPlayer (slot + 1 ), cmd);
639639 ApplyTools (fb, pInfo, PRE_PROCESSING);
640640
641641 if (sar_tas_debug.GetInt () > 0 ) {
@@ -660,6 +660,7 @@ void TasPlayer::PostProcess(int slot, void *player, CUserCmd *cmd) {
660660
661661 TasFramebulk& fb = RequestProcessedFramebulkAt (slot, tasTick);
662662
663+ UpdateTools (slot, fb, POST_PROCESSING);
663664 auto playerInfo = GetPlayerInfo (slot, player, cmd);
664665
665666 float orig_forward = cmd->forwardmove ;
@@ -782,14 +783,16 @@ void TasPlayer::ApplyMoveAnalog(Vector moveAnalog, CUserCmd *cmd) {
782783 }
783784}
784785
785- void TasPlayer::ApplyTools (TasFramebulk &fb, const TasPlayerInfo &pInfo, TasToolProcessingType processType) {
786- int slot = pInfo.slot ;
787-
786+ void TasPlayer::UpdateTools (int slot, const TasFramebulk &fb, TasToolProcessingType processType) {
788787 for (TasToolCommand cmd : fb.toolCmds ) {
789788 auto tool = TasTool::GetInstanceByName (slot, cmd.tool ->GetName ());
790789 if (!CanProcessTool (tool, processType)) continue ;
791790 tool->SetParams (cmd.params );
792791 }
792+ }
793+
794+ void TasPlayer::ApplyTools (TasFramebulk &fb, const TasPlayerInfo &pInfo, TasToolProcessingType processType) {
795+ int slot = pInfo.slot ;
793796
794797 FOR_TAS_SCRIPT_VERSIONS_UNTIL (2 ) {
795798 // use old "earliest first" ordering system (partially also present in TasTool::SetParams)
0 commit comments