3d: Avoid zero division in update_motion()

This commit is contained in:
kichikuou
2025-06-16 11:43:26 +09:00
parent e2440a5a44
commit 8d120b8a4d
+3 -1
View File
@@ -131,7 +131,9 @@ static void update_motion(struct motion *m, float delta_frame)
}
break;
case RE_MOTION_STATE_LOOP:
if (m->current_frame > m->loop_frame_end)
if (m->loop_frame_begin == m->loop_frame_end)
m->current_frame = m->loop_frame_begin;
else if (m->current_frame > m->loop_frame_end)
m->current_frame = m->loop_frame_begin + fmodf(m->current_frame - m->loop_frame_begin, m->loop_frame_end - m->loop_frame_begin);
break;
default: