Fix T50230: Rigid Body simulation shouldn't step when time is beyond cached area
[blender.git] / source / blender / blenkernel / intern / rigidbody.c
index 390e6dedc3fc41ac5b55ab67902b91263b3e368c..c4fb0aec97b9c205710f8a3d5c8876be2d36324f 100644 (file)
@@ -1563,12 +1563,8 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
        BKE_ptcache_id_time(&pid, scene, ctime, &startframe, &endframe, NULL);
        cache = rbw->pointcache;
 
-       if (ctime <= startframe) {
-               rbw->ltime = startframe;
-               return;
-       }
        /* make sure we don't go out of cache frame range */
-       else if (ctime > endframe) {
+       if (ctime > endframe) {
                ctime = endframe;
        }
 
@@ -1584,7 +1580,6 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime)
 
        if (BKE_ptcache_read(&pid, ctime, can_simulate)) {
                BKE_ptcache_validate(cache, (int)ctime);
-               rbw->ltime = ctime;
                return;
        }