X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetwork%2Ftrain.cpp;h=4b6c8e86e1233955d3d4d04b19b6e1d27c522670;hb=02fe62e0026dd25fd3ff4d5172c0ff097b7c68c9;hp=6a0c3a8b8fa99006c56275e9382618f05998b962;hpb=378f04522aa762729c0d5651fb60ad7e4d8ba9f3;p=r2c2.git diff --git a/source/network/train.cpp b/source/network/train.cpp index 6a0c3a8..4b6c8e8 100644 --- a/source/network/train.cpp +++ b/source/network/train.cpp @@ -32,6 +32,12 @@ void NetTrain::set_control(const string &c, float v) client.send(pkt); } +float NetTrain::get_control(const string &c) const +{ + map::const_iterator i = controls.find(c); + return i!=controls.end() ? i->second : 0; +} + void NetTrain::set_function(unsigned i, bool set) { TrainFunctionPacket pkt;