Skip to content

Commit 369f4f7

Browse files
committed
fix: resolve tas tick 0 commands issues
Tick 0 raw commands were unnecessarily discarded. Weird, as it's only used internally by tick 1 sampling - tick 0 data is never used externally. Additionally, command execution order was incorrect.
1 parent 985c2b0 commit 369f4f7

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/Features/Tas/TasPlayer.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ TasFramebulk TasPlayer::SamplePreProcessedFramebulk(int slot, int tasTick, void
625625
console->Print("(TAS: rawtick) %s\n", fb.ToString().c_str());
626626
}
627627

628-
if (tasTick == 0 || !framebulkUpdated) {
628+
if (!framebulkUpdated) {
629629
std::vector<std::string> emptyCommands;
630630
fb.commands = emptyCommands;
631631
}
@@ -638,12 +638,10 @@ TasFramebulk TasPlayer::SamplePreProcessedFramebulk(int slot, int tasTick, void
638638
if (tasTick == 1) {
639639
// on tick 1, we'll run the commands from the bulk at tick 0 because
640640
// of the annoying off-by-one thing explained in FetchInputs
641-
TasFramebulk fb0 = RequestProcessedFramebulkAt(slot, 0);
641+
TasFramebulk fbTick0 = RequestProcessedFramebulkAt(slot, 0);
642642

643-
if (fb0.tick == 0) {
644-
for (std::string cmd : fb0.commands) {
645-
fb.commands.push_back(cmd);
646-
}
643+
if (fbTick0.tick == 0) {
644+
fb.commands.insert(fb.commands.begin(), fbTick0.commands.begin(), fbTick0.commands.end());
647645
}
648646
}
649647

0 commit comments

Comments
 (0)