From 4990065ada2ab85944c9abe7f7416ff79804aa2d Mon Sep 17 00:00:00 2001 From: Steffen Pohle Date: Sat, 23 Dec 2023 19:16:16 +0100 Subject: [PATCH] forgot to delete destination if assign and dest are equal --- server/locomotive.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/locomotive.cc b/server/locomotive.cc index 176392a..078f6af 100644 --- a/server/locomotive.cc +++ b/server/locomotive.cc @@ -1075,6 +1075,7 @@ int Locomotives::Loop() { continue; } else { + debug (0, "%s:%d Locomotive [%s] is doing NOTHING", __FILE__, __LINE__, loco->name); timer_start(&loco->auto_timenext); loco->auto_onroute = LOCO_OR_SEARCH; } @@ -1088,6 +1089,13 @@ int Locomotives::Loop() { SetModeMan(loco->name); continue; } + if (strcmp(loco->blockassign, loco->blockdest) == 0) { + loco->blockdest[0] = 0; + debug (0, "* Locomotive '%s' DEST == ASSING", loco->name); + jp.Clear(); + jp.AddObject("locomotive",_GetJSON(lnum)); + if(network) network->ChangeListPushToAll(jp.ToString()); + } // try to find and lock a way if (Loco_SearchAndLock(loco)) {