From e9b6fb97d5ee38c75f7e023e79a642d057ff99cd Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 20 Jul 2008 17:14:43 +0000 Subject: [PATCH] train direction command swap arguments --- hostside/README.commands | 2 +- hostside/commands.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hostside/README.commands b/hostside/README.commands index 463dd53..758e1b4 100644 --- a/hostside/README.commands +++ b/hostside/README.commands @@ -199,7 +199,7 @@ INCOMPLETE LIST OF OTHER COMMANDS movfeat++ } see route++ !movfeat } see !route - direction forwards|backwards|change + direction forwards|backwards|change DIRECT NMRA AND PIC INSTRUCTIONS diff --git a/hostside/commands.c b/hostside/commands.c index 52d2875..76be340 100644 --- a/hostside/commands.c +++ b/hostside/commands.c @@ -351,13 +351,14 @@ static int cmd_direction(ParseState *ps, const CmdInfo *ci) { Train *tra; int backwards; + MUSTECR( ps_needtrain(ps,&tra) ); + MUSTECR( ps_needword(ps) ); if (!thiswordstrcmp(ps,"forwards")) backwards= 0; else if (!thiswordstrcmp(ps,"backwards")) backwards= 1; else if (!thiswordstrcmp(ps,"change")) backwards= !tra->backwards; else return badcmd(ps, "direction must be forwards|backwards|change"); - MUSTECR( ps_needtrain(ps,&tra) ); MUSTECR( ps_neednoargs(ps) ); MUSTECRPREDICT( safety_setdirection(tra,backwards,CMDPPC) ); -- 2.30.2