From ad39c79490e2043cf7442696da4e8ed98445abec Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Mon, 17 Apr 2017 16:03:20 +0000
Subject: [PATCH] Fix invalid vehicle id parsed for departed entries

---
 common.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/common.js b/common.js
index 32022dc..37368a1 100644
--- a/common.js
+++ b/common.js
@@ -73,7 +73,7 @@
 		type = 'GT8S';
 		low = 0;
 		
-		if(id == 313) {
+		if(id == 313 || id == 323) {
 			type = 'GT8C'
 			low = 1;
 		}
@@ -86,7 +86,7 @@
 		type = 'N8S-NF';
 		low = 0;
 		
-		if((451 <= id && id <= 453) || id == 462) {
+		if((451 <= id && id <= 455) || id == 462) {
 			type = 'N8C-NF';
 			low = 1;
 		}
@@ -135,6 +135,14 @@
 	};
 }
 
+function tramIdToVehicleId(tramId) {
+	if(0 <= tramId && tramId <= 999) {
+		var vehicleId = '0000' + (tramId + 736);
+		vehicleId = vehicleId.substr(vehicleId.length - 4)
+		return '635218529567218' + vehicleId;
+	}
+}
+
 // Element mangling
 function deleteChildren(element) {
 	while(element.lastChild) element.removeChild(element.lastChild);

--
Gitblit v1.9.1