From edf21b8bfe1c9f64bab53b535a8e997c19d64042 Mon Sep 17 00:00:00 2001 From: feos Date: Thu, 17 Nov 2016 20:05:41 +0300 Subject: [PATCH] fix tastudio crashes when: - setting 0 space for disk states - righclicking on selection if a bunch of selected frames contains the last frame - cutting the last frame --- BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs | 3 ++- .../tools/TAStudio/GreenzoneSettings.Designer.cs | 5 +++++ BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs index 271ddc13e1..b01f054400 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.Editing.cs @@ -125,7 +125,8 @@ namespace BizHawk.Client.Common foreach (var frame in frames.OrderByDescending(x => x)) // Removin them in reverse order allows us to remove by index; { - _log.RemoveAt(frame); + if (frame < _log.Count) + _log.RemoveAt(frame); if (BindMarkersToInput) // TODO: This is slow, is there a better way to do it? { bool wasRecording = ChangeLog.IsRecording; diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.Designer.cs index 27a62483a7..783645dcce 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/GreenzoneSettings.Designer.cs @@ -172,6 +172,11 @@ namespace BizHawk.Client.EmuHawk 65536, 0, 0, + 0}); + this.DiskCapacityNumeric.Minimum = new decimal(new int[] { + 1, + 0, + 0, 0}); this.DiskCapacityNumeric.Name = "DiskCapacityNumeric"; this.DiskCapacityNumeric.Size = new System.Drawing.Size(55, 20); diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs index 3e850bedac..32a507b6e0 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.ListView.cs @@ -564,7 +564,11 @@ namespace BizHawk.Client.EmuHawk { _rightClickInput = new string[TasView.SelectedRows.Count()]; _rightClickFrame = TasView.FirstSelectedIndex.Value; - CurrentTasMovie.GetLogEntries().CopyTo(_rightClickFrame, _rightClickInput, 0, TasView.SelectedRows.Count()); + try + { + CurrentTasMovie.GetLogEntries().CopyTo(_rightClickFrame, _rightClickInput, 0, TasView.SelectedRows.Count()); + } + catch { } if (_rightClickControl && _rightClickShift) _rightClickFrame += _rightClickInput.Length; }