diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:55:58 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:55:58 +0100 |
commit | d1a8285f818eb7e5c3d6a05709ea21a808490b8c (patch) | |
tree | 326578f0505cbed07cfe60de530022822dc237ac /app/bin/cswitchmotor.c | |
parent | 16e9630b79f0a7a90c6cedb6781175bb8b337dc1 (diff) |
New upstream version 5.1.0upstream/5.1.0
Diffstat (limited to 'app/bin/cswitchmotor.c')
-rw-r--r-- | app/bin/cswitchmotor.c | 23 |
1 files changed, 15 insertions, 8 deletions
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 <ctype.h> -#include "track.h" -#include "trackx.h" +#include <string.h> + #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); + }; } |