From 4f2dc0934f876d585e324616436a43aa598707d8 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Fri, 18 Mar 2022 20:03:19 +0000 Subject: [PATCH] prevent DC addr 0 --- TrackManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TrackManager.cpp b/TrackManager.cpp index 991ff37..17dd754 100644 --- a/TrackManager.cpp +++ b/TrackManager.cpp @@ -2,7 +2,7 @@ * © 2022 Chris Harlow * All rights reserved. * - * This file is part of Asbelos DCC API + * This file is part of DCC++EX * * This is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -150,7 +150,7 @@ bool TrackManager::parseJ(Print *stream, int16_t params, int16_t p[]) if (params==2 && p[1]==HASH_KEYWORD_OFF) // <= id OFF> return setTrackMode(p[0],TRACK_MODE_OFF); - if (params==3 && p[1]==HASH_KEYWORD_DC) // <= id DC cab> + if (params==3 && p[1]==HASH_KEYWORD_DC && p[2]>0) // <= id DC cab> return setTrackMode(p[0],p[2]); return false;