]> git.tdb.fi Git - r2c2.git/commitdiff
Bugfixes
authorMikko Rasa <tdb@tdb.fi>
Thu, 14 Oct 2010 19:03:05 +0000 (19:03 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 14 Oct 2010 19:03:05 +0000 (19:03 +0000)
source/engineer/trainproperties.cpp
source/libmarklin/train.cpp

index bdd39fb97622f2e3c2f707ec892796abc0958ea2..a8d78a028f3e23826dc1ab0db9a72be47f187cee 100644 (file)
@@ -37,7 +37,7 @@ TrainProperties::TrainProperties(Engineer &e, const GLtk::Resources &r, Train *t
 
        const map<unsigned, VehicleType *> &vehs = engineer.get_catalogue().get_vehicles();
        unsigned n = 0;
-       for(map<unsigned, VehicleType *>::const_iterator i=vehs.begin(); i!=vehs.end(); ++i, ++n)
+       for(map<unsigned, VehicleType *>::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)));
index d6ed044954286ba549c0da0c0e75d363e300861e..f0a0bf32dcf502c4e6728ed79812a40b90ef5906 100644 (file)
@@ -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();
 }