From d1a8285f818eb7e5c3d6a05709ea21a808490b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 19 Mar 2018 19:55:58 +0100 Subject: New upstream version 5.1.0 --- app/bin/cswitchmotor.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'app/bin/cswitchmotor.c') diff --git a/app/bin/cswitchmotor.c b/app/bin/cswitchmotor.c index dbe006c..3d39a68 100644 --- a/app/bin/cswitchmotor.c +++ b/app/bin/cswitchmotor.c @@ -50,10 +50,17 @@ */ #include -#include "track.h" -#include "trackx.h" +#include + #include "compound.h" +#include "cundo.h" +#include "custom.h" +#include "fileio.h" #include "i18n.h" +#include "param.h" +#include "track.h" +#include "trackx.h" +#include "utility.h" EXPORT TRKTYP_T T_SWITCHMOTOR = -1; @@ -271,7 +278,7 @@ static DIST_T DistanceSwitchMotor (track_p t, coOrd * p ) { switchmotorData_p xx = GetswitchmotorData(t); if (xx->turnout == NULL) return 0; - return GetTrkDistance(xx->turnout,*p); + return GetTrkDistance(xx->turnout,p); } static void DescribeSwitchMotor (track_p trk, char * str, CSIZE_T len ) @@ -769,11 +776,11 @@ EXPORT void CheckDeleteSwitchmotor(track_p t) track_p sm; switchmotorData_p xx; - sm = FindSwitchMotor( t ); - if (sm == NULL) return; - xx = GetswitchmotorData (sm); - NoticeMessage(_("Deleting Switch Motor %s"),_("Ok"),NULL,xx->name); - DeleteTrack (sm, FALSE); + while ((sm = FindSwitchMotor( t ))) { //Cope with multiple motors for one Turnout! + xx = GetswitchmotorData (sm); + InfoMessage(_("Deleting Switch Motor %s"),xx->name); + DeleteTrack (sm, FALSE); + }; } -- cgit v1.2.3