X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrainrouter.cpp;h=6e588e7a7ac4302c97db28f968fa1c8d04a01b27;hb=a993f204ba2cd282637814caec3ab115040fc0cc;hp=160c5b6a0c904cee6112608d033f9fef8bbe8c01;hpb=d0af7846e05691d65d8021e46c8f81e8ca05199a;p=r2c2.git diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 160c5b6..6e588e7 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -163,9 +163,6 @@ void TrainRouter::tick(const Time::TimeStamp &, const Time::TimeDelta &) void TrainRouter::save(list &st) const { - if(!tag.empty()) - st.push_back((DataFile::Statement("tag"), tag)); - st.push_back((DataFile::Statement("priority"), priority)); if(!routes.empty()) @@ -231,8 +228,7 @@ void TrainRouter::block_reserved(Block &block, Train *t) bool exit_conflict = (exit==static_cast(other_entry)); // TODO: speed matching with preceding train - // XXX Should invent a better way to get our counterpart from the other train - TrainRouter *other_router = dynamic_cast(other_train->get_tagged_ai("router")); + TrainRouter *other_router = other_train->get_ai_of_type(); int other_prio = (other_router ? other_router->get_priority() : 0); if(!entry_conflict && !exit_conflict && other_prio