mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-07 06:18:14 +03:00
3d: Avoid zero division in update_motion()
This commit is contained in:
+3
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user