From f431c12b85e44039a3641ea3b1a9ec3847dc89e6 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Wed, 4 Jun 2025 13:20:02 +0200 Subject: [PATCH] Fix model[] not supporting float frames --- src/gui/guiFormSpecMenu.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp index 38193684f..29ff83af4 100644 --- a/src/gui/guiFormSpecMenu.cpp +++ b/src/gui/guiFormSpecMenu.cpp @@ -2852,12 +2852,13 @@ void GUIFormSpecMenu::parseModel(parserData *data, const std::string &element) e->enableContinuousRotation(inf_rotation); e->enableMouseControl(mousectrl); - s32 frame_loop_begin = 0; - s32 frame_loop_end = 0x7FFFFFFF; + f32 frame_loop_begin = 0; + // This will be clamped to the animation duration. + f32 frame_loop_end = std::numeric_limits::infinity(); if (frame_loop.size() == 2) { - frame_loop_begin = stoi(frame_loop[0]); - frame_loop_end = stoi(frame_loop[1]); + frame_loop_begin = stof(frame_loop[0]); + frame_loop_end = stof(frame_loop[1]); } e->setFrameLoop(frame_loop_begin, frame_loop_end);