aboutsummaryrefslogtreecommitdiff
path: root/trainhud.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-10-22 20:32:02 +0200
committerorwell96 <mono96.mml@gmail.com>2016-10-22 20:32:02 +0200
commita3d8c3ae16021881b0b39cfe473f16ae62f5f81e (patch)
tree3acc2f234e9b7746fba53fd1e26ae127e175d655 /trainhud.lua
parent7f92ac4bd2874d4609a50c95554cf5b956a52803 (diff)
parentdef57bcab87d57285b194827e63e734004eb3bfb (diff)
downloadadvtrains-a3d8c3ae16021881b0b39cfe473f16ae62f5f81e.tar.gz
advtrains-a3d8c3ae16021881b0b39cfe473f16ae62f5f81e.tar.bz2
advtrains-a3d8c3ae16021881b0b39cfe473f16ae62f5f81e.zip
Merge branch 'master' of https://github.com/orwell96/advtrains
Diffstat (limited to 'trainhud.lua')
-rw-r--r--trainhud.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/trainhud.lua b/trainhud.lua
index 601b28f..81b9e94 100644
--- a/trainhud.lua
+++ b/trainhud.lua
@@ -8,6 +8,9 @@ end)
function advtrains.set_trainhud(name, text)
local hud = advtrains.hud[name]
local player=minetest.get_player_by_name(name)
+ if not player then
+ return
+ end
if not hud then
hud = {}
advtrains.hud[name] = hud
@@ -53,4 +56,4 @@ function advtrains.hud_train_format(train, flip)
elseif vel>0 then
return firstLine.."\n"..secondLine.."\nPress up to accelerate, down to decelerate, sneak to stop."
end
-end \ No newline at end of file
+end