/* $Id$
-This file is part of the MSP Märklin suite
+This file is part of R²C²
Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
#include <msp/gltk/label.h>
#include <msp/strings/formatter.h>
#include <msp/strings/lexicalcast.h>
-#include "libmarklin/driver.h"
-#include "libmarklin/vehicle.h"
-#include "libmarklin/vehicletype.h"
+#include "libr2c2/driver.h"
+#include "libr2c2/vehicle.h"
+#include "libr2c2/vehicletype.h"
#include "engineer.h"
#include "trainproperties.h"
using namespace std;
using namespace Msp;
-using namespace Marklin;
+using namespace R2C2;
TrainProperties::TrainProperties(Engineer &e, Train *t):
engineer(e),
lst_vehicles->remove(selected);
- unsigned n_vehicles = train->get_n_vehicles()-rem_vehicles.size();
+ unsigned n_vehicles = (train ? train->get_n_vehicles()-rem_vehicles.size() : 0);
if(static_cast<unsigned>(selected)>=n_vehicles)
add_vehicles.erase(add_vehicles.begin()+(selected-n_vehicles));
else