aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-02-20 11:14:37 +0100
committerorwell96 <mono96.mml@gmail.com>2017-02-20 11:14:37 +0100
commite4e76322ba74e1ffb465ca5bbfc420d8857aea01 (patch)
treea080fcb4b979142f988db7b309dff62131114d7b /advtrains
parente97287614cbaf3aa585eae2a92e723f7467bdcc8 (diff)
downloadadvtrains-e4e76322ba74e1ffb465ca5bbfc420d8857aea01.tar.gz
advtrains-e4e76322ba74e1ffb465ca5bbfc420d8857aea01.tar.bz2
advtrains-e4e76322ba74e1ffb465ca5bbfc420d8857aea01.zip
Fix crash when ATC rail exists but no command is saved.
Crash was caused by a concatenation for a debug message. atprint can handle nil if passed as separate parameter Setting the train's atc command to nil just means that there is no command.
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/advtrains/atc.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/advtrains/atc.lua b/advtrains/advtrains/atc.lua
index 5a8e76b..6d484b1 100644
--- a/advtrains/advtrains/atc.lua
+++ b/advtrains/advtrains/atc.lua
@@ -40,14 +40,14 @@ function atc.send_command(pos, par_tid)
advtrains.round_vector_floor_y(train.path[index+train.movedir])
)
advtrains.trains[train_id].atc_command=atc.controllers[pts].command
- atprint("Sending ATC Command: "..atc.controllers[pts].command)
+ atprint("Sending ATC Command: ", atc.controllers[pts].command)
return true
end
end
atwarn("ATC rail at", pos, ": Rail not on train's path! Can't determine arrow direction. Assuming +!")
advtrains.trains[train_id].atc_arrow=true
advtrains.trains[train_id].atc_command=atc.controllers[pts].command
- atprint("Sending ATC Command: "..atc.controllers[pts].command)
+ atprint("Sending ATC Command: ", atc.controllers[pts].command)
else
atwarn("ATC rail at", pos, ": Sending command failed: The train",train_id,"does not exist. This seems to be a bug.")
end