aboutsummaryrefslogtreecommitdiff
path: root/advtrains/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/helpers.lua')
-rw-r--r--advtrains/helpers.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua
index 511d32e..3514f55 100644
--- a/advtrains/helpers.lua
+++ b/advtrains/helpers.lua
@@ -381,6 +381,7 @@ end
-- decodes a position encoded with encode_pos
function advtrains.decode_pos(pts)
+ if not pts or not #pts==6 then return nil end
local stry = string.sub(pts, 1,4)
local strx = string.sub(pts, 5,8)
local strz = string.sub(pts, 9,12)