Fixed crash problem

This commit is contained in:
Gabriel Pérez-Cerezo 2016-10-05 15:27:16 +02:00
parent cacd0da431
commit 307b4048ac
No known key found for this signature in database
GPG Key ID: 90422B01A46D0B3E
1 changed files with 4 additions and 1 deletions

View File

@ -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