X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Faicontrol.cpp;h=6e1c4b16ab9f925471d0769f5bfa53b6ccbc70e6;hb=cb4e53ba1b8ea41b978190de6668e9862b9cfea8;hp=e5bed9ce3ba3ee71a61676f196ef673693ec667a;hpb=d3a7a9e9ad694d52ccca8b6038501772fdc1dfd5;p=r2c2.git diff --git a/source/libr2c2/aicontrol.cpp b/source/libr2c2/aicontrol.cpp index e5bed9c..6e1c4b1 100644 --- a/source/libr2c2/aicontrol.cpp +++ b/source/libr2c2/aicontrol.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include "aicontrol.h" #include "catalogue.h" #include "layout.h" @@ -23,7 +16,7 @@ AIControl::AIControl(Train &t): state(NORMAL), need_update(false) { - train.signal_arrived.connect(sigc::mem_fun(this, &AIControl::arrived)); + train.signal_ai_event.connect(sigc::mem_fun(this, &AIControl::event)); } void AIControl::set_target_speed(float s) @@ -111,9 +104,10 @@ void AIControl::tick(const Time::TimeStamp &, const Time::TimeDelta &) train.set_active(false); } -void AIControl::arrived() +void AIControl::event(TrainAI &, const Message &ev) { - set_target_speed(0); + if(ev.type=="arrived") + set_target_speed(0); } } // namespace R2C2