From 8447b59b0fe597502e81b07d307cbb1f3a767ef7 Mon Sep 17 00:00:00 2001 From: Stefan Jahn Date: Wed, 15 Feb 2023 02:21:15 +0100 Subject: [PATCH] Fixed randomization on Windows platform --- videodev-simulation.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/videodev-simulation.cc b/videodev-simulation.cc index 56ff557..678fc6c 100644 --- a/videodev-simulation.cc +++ b/videodev-simulation.cc @@ -206,11 +206,15 @@ Simulation::Simulation() { void Simulation::Reset() { int i; + static int first = 1; LockMutex(); - time_t t = time(NULL); - srand (t); + if(first) { + time_t t = time(NULL); + srand (t); + first = 0; + } // // object movement