X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnetwork%2Fclient.cpp;h=41cd28e900a712a5f5cc5693777bec615381e4f7;hb=19a73af1fb956636cb8b9d563ffb6a42e827a5bf;hp=ac4f018e83d9b72777429aed65bda99d1725d197;hpb=754ac497179474d0266b55e881a084fef7d5d6a1;p=r2c2.git diff --git a/source/network/client.cpp b/source/network/client.cpp index ac4f018..41cd28e 100644 --- a/source/network/client.cpp +++ b/source/network/client.cpp @@ -1,10 +1,4 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2009-2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - +#include #include "client.h" using namespace std; @@ -63,10 +57,7 @@ void Client::set_halt(bool h) NetTrain &Client::get_train(unsigned addr) const { - map::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)