X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrainrouter.cpp;h=6e588e7a7ac4302c97db28f968fa1c8d04a01b27;hb=dec294d40194a640e7b4bccf20dd1baa4a87038c;hp=c39af92c246e9ed30ce78ded29d40832dc8e8925;hpb=3acb396462f2d6361423b744e489c13ef64c8114;p=r2c2.git diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index c39af92..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