X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Faicontrol.cpp;h=6e1c4b16ab9f925471d0769f5bfa53b6ccbc70e6;hb=dda1e6c8716b6ac70d63a3f6ff95474a8b8b7336;hp=3e31aaf638e602412fa8a184dfbde2796dabe41d;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/libr2c2/aicontrol.cpp b/source/libr2c2/aicontrol.cpp index 3e31aaf..6e1c4b1 100644 --- a/source/libr2c2/aicontrol.cpp +++ b/source/libr2c2/aicontrol.cpp @@ -16,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) @@ -104,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