-/* $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"
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)
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