]> git.tdb.fi Git - r2c2.git/commitdiff
Also use halt in sighandler
authorMikko Rasa <tdb@tdb.fi>
Tue, 8 Apr 2014 18:31:28 +0000 (21:31 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 8 Apr 2014 18:31:28 +0000 (21:31 +0300)
source/engineer/engineer.cpp

index fb0502dbfde6d7f4df131c368006b58967d027c7..789c6055cd699ce621a8c7f137a113bbacc4eb4b 100644 (file)
@@ -365,9 +365,7 @@ void Engineer::sighandler(int sig)
        {
                signal(sig, SIG_DFL);
                IO::print(IO::cerr, "Fatal signal received, terminating\n");
-               const map<unsigned, Train *> &trains = layout.get_trains();
-               for(map<unsigned, Train *>::const_iterator i=trains.begin(); i!=trains.end(); ++i)
-                       layout.get_driver().set_loco_speed(i->first, 0);
+               layout.get_driver().halt(true);
                layout.get_driver().flush();
                raise(sig);
        }