diff --git a/package.json b/package.json index 55a8942..8144ae8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tp_ets2_plugin", - "version": "3.2.8", + "version": "3.2.9", "description": "Euro Truck Simulator 2 Plugin for TouchPortal", "main": "src/bin/plugin.js", "scripts": { diff --git a/src/bin/config/cfg.json b/src/bin/config/cfg.json index 920e69a..ca25c84 100644 --- a/src/bin/config/cfg.json +++ b/src/bin/config/cfg.json @@ -1,5 +1,5 @@ { - "version": "3.2.8", + "version": "3.2.9", "refreshInterval": 500, "debug": false, "firstInstall": false, diff --git a/src/bin/modules/states/truck.js b/src/bin/modules/states/truck.js index 16f086d..1c91be8 100644 --- a/src/bin/modules/states/truck.js +++ b/src/bin/modules/states/truck.js @@ -563,7 +563,9 @@ const truckStates = async (TPClient, telemetry_path, logIt, timeout, path, cfg_p SpeedOld = Speed if(unit === "miles") { - Speed = Math.floor(Speed / 1.609344) + Speed = Math.round(Speed / 1.609344) + } else { + Speed = Math.round(Speed) } var data = { diff --git a/src/bin/plugin.js b/src/bin/plugin.js index 9244a0a..d76b032 100644 --- a/src/bin/plugin.js +++ b/src/bin/plugin.js @@ -344,14 +344,14 @@ if(Testing) { //Checks for TP exe setInterval(() => { - - isRunning(`TouchPortalServices.exe`, async (status) => { - if(status === false) { - logIt("MAIN", "ERROR", "TouchPortal is not Running anymore.") - exit() - } - }) - + if(system_path.basename(process.cwd()) === "ETS2_Dashboard") { + isRunning(`TouchPortalServices.exe`, async (status) => { + if(status === false) { + logIt("MAIN", "ERROR", "TouchPortal is not Running anymore.") + exit() + } + }) + } }, 200); main(path, cfg_path, telemetry_path)