]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/layout.cpp
Reserve two ids for double-address turnouts
[r2c2.git] / source / libmarklin / layout.cpp
index d32781578243a1631634d23ecf78e7223387ec93..fc3d86ed9e39cc51b6b4fef1733c1546184cf5a0 100644 (file)
@@ -73,9 +73,12 @@ void Layout::remove_track(Track &t)
        }
 }
 
-unsigned Layout::allocate_turnout_id()
+unsigned Layout::allocate_turnout_id(bool dbl)
 {
-       return next_turnout_id++;
+       unsigned result = next_turnout_id++;
+       if(dbl)
+               ++next_turnout_id;
+       return result;
 }
 
 void Layout::add_block(Block &b)