Prevent animation editor crashes on oversized numeric animation values#1201
Prevent animation editor crashes on oversized numeric animation values#1201Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/TombEngine/Tomb-Editor/sessions/09dfe144-572a-4705-be25-5d041275f11b Co-authored-by: Nickelony <20436882+Nickelony@users.noreply.github.com>
|
@copilot Would you be able to provide reproduction steps for the original issue? What do we have to do in order to get the original error before the fix was applied? Also, please double-check that the changes don't cause any regressions for other places in the code. |
Pre-fix repro is:
I also re-checked the scope for regressions: the helper is only used inside |
|
|
||
| private static void SetNumericValue(DarkNumericUpDown control, decimal value) | ||
| { | ||
| if (value < control.Minimum) |
There was a problem hiding this comment.
Blind extension of the minimum value may result in the absurd scenarios such as extending framerate limit or frame count limit to negative values. I believe this approach is wrong.
Selecting some
.wadanimations could throwArgumentOutOfRangeExceptioninFormAnimationEditorwhen stored animation values exceeded the defaultDarkNumericUpDownbounds. This surfaced while browsing/playing animations, before any user edit occurred.Root cause
SelectAnimation(...)assigned raw animation values directly into numeric controls.Change
FormAnimationEditorthat expands aDarkNumericUpDown'sMinimum/Maximumbefore assigning a value.SelectAnimation(...)to use that helper.Covered follow-up assignments
Behavioral impact