Tastudio - fix clone input when cloing multiple rows

This commit is contained in:
adelikat 2020-01-18 13:35:22 -06:00
parent 1519110691
commit 67ff6abb17
1 changed files with 3 additions and 2 deletions

View File

@ -736,11 +736,12 @@ namespace BizHawk.Client.EmuHawk
if (TasView.AnyRowsSelected)
{
var framesToInsert = TasView.SelectedRows;
var insertionFrame = Math.Min(TasView.LastSelectedIndex ?? 0 + 1, CurrentTasMovie.InputLogLength);
var insertionFrame = Math.Min((TasView.LastSelectedIndex ?? 0) + 1, CurrentTasMovie.InputLogLength);
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
var inputLog = framesToInsert
.Select(frame => CurrentTasMovie.GetInputLogEntry(frame));
.Select(frame => CurrentTasMovie.GetInputLogEntry(frame))
.ToList();
CurrentTasMovie.InsertInput(insertionFrame, inputLog);