From 8fc1ac9321c313bbfa526060486c492f69358a8e Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 16 Oct 2002 14:03:50 +0000 Subject: [PATCH] remove assertion; pose should automatically wrap --- panda/src/chan/animControl.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/src/chan/animControl.cxx b/panda/src/chan/animControl.cxx index 3401376f9e..ed596d2c4d 100644 --- a/panda/src/chan/animControl.cxx +++ b/panda/src/chan/animControl.cxx @@ -254,9 +254,12 @@ stop() { //////////////////////////////////////////////////////////////////// void AnimControl:: pose(int frame) { - nassertv(get_num_frames() > 0); + int num_frames = get_num_frames(); + nassertv(num_frames > 0); - nassertv(frame >= 0 && frame < get_num_frames()); + // Modulo the number of frames. + frame = frame - cfloor(frame / num_frames) * num_frames; + nassertv(frame >= 0 && frame < num_frames); _as_of_time = ClockObject::get_global_clock()->get_frame_time(); _playing = false;