From: Mikko Rasa Date: Thu, 14 Oct 2010 19:03:05 +0000 (+0000) Subject: Bugfixes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=8c721bbf508ddcf1f1a375c8d3d99241219b36af;p=r2c2.git Bugfixes --- diff --git a/source/engineer/trainproperties.cpp b/source/engineer/trainproperties.cpp index bdd39fb..a8d78a0 100644 --- a/source/engineer/trainproperties.cpp +++ b/source/engineer/trainproperties.cpp @@ -37,7 +37,7 @@ TrainProperties::TrainProperties(Engineer &e, const GLtk::Resources &r, Train *t const map &vehs = engineer.get_catalogue().get_vehicles(); unsigned n = 0; - for(map::const_iterator i=vehs.begin(); i!=vehs.end(); ++i, ++n) + for(map::const_iterator i=vehs.begin(); i!=vehs.end(); ++i) { if(!i->second->is_locomotive()) continue; @@ -45,6 +45,8 @@ TrainProperties::TrainProperties(Engineer &e, const GLtk::Resources &r, Train *t drp_type->append(format("%d %s", i->second->get_article_number(), i->second->get_name())); if(train && i->second==&train->get_locomotive_type()) drp_type->set_selected_index(n); + + ++n; } add(*(ent_name = new GLtk::Entry(res))); diff --git a/source/libmarklin/train.cpp b/source/libmarklin/train.cpp index d6ed044..f0a0bf3 100644 --- a/source/libmarklin/train.cpp +++ b/source/libmarklin/train.cpp @@ -652,7 +652,7 @@ void Train::halt_event(bool h) void Train::block_reserved(const Block &block, const Train *train) { - if(&block==pending_block && !train) + if(&block==pending_block && !train && !reserving) reserve_more(); }