From bf0d5936a84425e851d25f9fde83a965024693e9 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 23 Apr 2010 19:29:58 +0000 Subject: [PATCH] Don't reserve blocks when not active --- source/libmarklin/train.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libmarklin/train.cpp b/source/libmarklin/train.cpp index 634f45c..9f97c33 100644 --- a/source/libmarklin/train.cpp +++ b/source/libmarklin/train.cpp @@ -169,8 +169,7 @@ void Train::set_route(const Route *r) } } - if(active) - reserve_more(); + reserve_more(); signal_route_changed.emit(route); } @@ -630,6 +629,9 @@ void Train::block_reserved(const Block &block, const Train *train) unsigned Train::reserve_more() { + if(!active) + return; + BlockRef *last = 0; if(!rsv_blocks.empty()) last = &rsv_blocks.back(); -- 2.45.2