*** a/motion.c  2006-07-04 11:18:49.000000000 +0200
--- b/motion.c  2006-07-12 09:40:41.000000000 +0200
*************** static void *motion_loop(void *arg)
*** 1192,1200 ****
                /***** MOTION LOOP - REFERENCE FRAME SECTION *****/

                        /* Update reference frame */
!                       if (cnt->moved && (cnt->track.type || cnt->conf.lightswitch)) {
                                /* Prevent the motion created by moving camera or sudden light intensity
!                                * being detected by creating a fresh reference frame
                                 */
                                memcpy(cnt->imgs.ref, cnt->imgs.image_virgin, cnt->imgs.size);
                        } else if (cnt->threshold) {
--- 1192,1202 ----
                /***** MOTION LOOP - REFERENCE FRAME SECTION *****/

                        /* Update reference frame */
!                       if ((cnt->diffs > cnt->threshold * 2) || (cnt->moved && (cnt->track.type || cnt->conf.lightswitch))) {
                                /* Prevent the motion created by moving camera or sudden light intensity
!                                * being detected by creating a fresh reference frame. Decaying is also
!                                * disabled when motion is above a certain threshold to make tracking
!                                * more accurate.
                                 */
                                memcpy(cnt->imgs.ref, cnt->imgs.image_virgin, cnt->imgs.size);
                        } else if (cnt->threshold) {

