1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix model[] not supporting float frames

This commit is contained in:
Lars Mueller 2025-06-04 13:20:02 +02:00 committed by SmallJoker
parent 38255cb6bb
commit f431c12b85

View file

@ -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<f32>::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);