From: Mikko Rasa Date: Wed, 20 Nov 2013 12:37:12 +0000 (+0200) Subject: Fix route choices in RouterPanel X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0d95d81bd2165d5b7e70d7e659b7806eb9cbba7e;p=r2c2.git Fix route choices in RouterPanel --- diff --git a/source/engineer/routerpanel.cpp b/source/engineer/routerpanel.cpp index 5097eda..11056ea 100644 --- a/source/engineer/routerpanel.cpp +++ b/source/engineer/routerpanel.cpp @@ -14,7 +14,7 @@ using namespace R2C2; string route_name(const Route *const &route) { - return route->get_name(); + return route ? route->get_name() : "(none)"; } RouterPanel::RouterPanel(Engineer &e, Train &t): @@ -36,9 +36,11 @@ RouterPanel::RouterPanel(Engineer &e, Train &t): dynamic_cast(get_item(widgets, "btn_goto"))->signal_clicked.connect(sigc::mem_fun(this, &RouterPanel::goto_clicked)); + routes.append(0); const set &lroutes = train.get_layout().get_all(); for(set::const_iterator i=lroutes.begin(); i!=lroutes.end(); ++i) - routes.append(*i); + if(!(*i)->is_temporary()) + routes.append(*i); TrainRouter *router = train.get_ai_of_type(); if(!router)