aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-03 21:35:42 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-12-03 21:35:42 +0100
commit3db3f24857464e7b58234f3ae5ee3449961879df (patch)
treeecc68da94b39378519b69409247ebcde784c33fa /advtrains/trainlogic.lua
parent25a335203f81fb80effed30f74aed2ed7d488837 (diff)
downloadadvtrains-3db3f24857464e7b58234f3ae5ee3449961879df.tar.gz
advtrains-3db3f24857464e7b58234f3ae5ee3449961879df.tar.bz2
advtrains-3db3f24857464e7b58234f3ae5ee3449961879df.zip
Tentative fix for #31
This might fix #31 by clearing the HUD entry for the player when joining
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 580a7d4..bc24feb 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -116,8 +116,10 @@ function advtrains.tp_player_to_train(player)
player:setpos(train.last_pos)
end
end
-minetest.register_on_joinplayer(function()
+minetest.register_on_joinplayer(function(player)
return advtrains.pcall(function()
+ advtrains.hud[player:get_player_name()] = nil
+ advtrains.hhud[player:get_player_name()] = nil
--independent of this, cause all wagons of the train which are loaded to reattach their players
--needed because already loaded wagons won't call reattach_all()
for _,wagon in pairs(minetest.luaentities) do