]> git.tdb.fi Git - r2c2.git/commitdiff
Set delay to zero before emitting signal_departed
authorMikko Rasa <tdb@tdb.fi>
Thu, 2 Apr 2015 21:50:33 +0000 (00:50 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 2 Apr 2015 21:50:33 +0000 (00:50 +0300)
source/libr2c2/trainrouter.cpp

index cc6277f87e9083132a20c8ccf4abea045db2b26f..2eac902df892875d7689134da69e08675d822d4d 100644 (file)
@@ -241,10 +241,10 @@ void TrainRouter::tick(const Time::TimeDelta &dt)
                        if(delay<Time::zero)
                        {
                                duration = max(duration+delay, Time::zero);
+                               delay = Time::zero;
                                train.ai_message(Message("set-target-speed", train.get_maximum_speed()));
                                signal_departed.emit();
                                signal_event.emit(Message("departed"));
-                               delay = Time::zero;
                        }
                }
                else if(duration)