From 867bd64a1cf85f36c80c78e637c4d4f274860427 Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 24 May 2008 01:55:16 +0000 Subject: [PATCH] do not confuse ourselves if new plan includes existing moving motion --- hostside/safety.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hostside/safety.c b/hostside/safety.c index 6b9ca79..289fac3 100644 --- a/hostside/safety.c +++ b/hostside/safety.c @@ -893,12 +893,15 @@ ErrorCode predict(Train *tra, struct timeval tnow, unsigned flags, /* install the new plan, if any */ if (seg->motion_newplan) { - if (!seg->now_present) { + if (seg->motion_newplan == seg->motion) { + /* excellent, already doing it */ + } else if (!seg->now_present) { MovPosComb target= movpos_change_intent(seg->motion_newplan); ec= movpos_change(seg, target, -1, seg->motion_newplan); assert(!ec); /* motion is updated by movpos_change */ } else { + /* we'll do it later, then */ seg->motion= seg->motion_newplan; } seg->motion_newplan= 0; -- 2.30.2