]> git.tdb.fi Git - r2c2.git/blobdiff - source/network/client.cpp
Remove a queued block reservation if the block is released
[r2c2.git] / source / network / client.cpp
index 33e7feac274ea9628d6688ed9758fd81a3305dc4..41cd28e900a712a5f5cc5693777bec615381e4f7 100644 (file)
@@ -1,10 +1,4 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2009  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
+#include <msp/core/maputils.h>
 #include "client.h"
 
 using namespace std;
@@ -63,10 +57,7 @@ void Client::set_halt(bool h)
 
 NetTrain &Client::get_train(unsigned addr) const
 {
-       map<unsigned, NetTrain *>::const_iterator i = trains.find(addr);
-       if(i==trains.end())
-               throw KeyError("Unknown train");
-       return *i->second;
+       return *get_item(trains, addr);
 }
 
 void Client::receive(const DriverStatePacket &pkt)