aboutsummaryrefslogtreecommitdiff
path: root/wagons.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-11-25 22:35:57 +0100
committerorwell96 <mono96.mml@gmail.com>2016-11-25 22:35:57 +0100
commit3afa9a3434f7144ffb08b3f02642ce3ca1042ccf (patch)
tree2163d67a8891876a45755ea9b7e18bb6ed8822d4 /wagons.lua
parent9859d8870dc2f55ec44151e46861adbb203e47f5 (diff)
downloadadvtrains-3afa9a3434f7144ffb08b3f02642ce3ca1042ccf.tar.gz
advtrains-3afa9a3434f7144ffb08b3f02642ce3ca1042ccf.tar.bz2
advtrains-3afa9a3434f7144ffb08b3f02642ce3ca1042ccf.zip
Fix hud not disappearing when pressing Shift+Use
Diffstat (limited to 'wagons.lua')
-rw-r--r--wagons.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/wagons.lua b/wagons.lua
index a82bde2..8348353 100644
--- a/wagons.lua
+++ b/wagons.lua
@@ -257,18 +257,23 @@ function wagon:on_step(dtime)
for seatno, seat in ipairs(self.seats) do
if seat.driving_ctrl_access then
local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno])
+ local get_off_pressed=false
if driver and driver:get_player_control_bits()~=self.old_player_control_bits then
local pc=driver:get_player_control()
advtrains.on_control_change(pc, self:train(), self.wagon_flipped)
if pc.aux1 and pc.sneak then
- self:get_off(seatno)
+ get_off_pressed=true
end
self.old_player_control_bits=driver:get_player_control_bits()
end
if driver then
- advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped)
+ if get_off_pressed then
+ self:get_off(seatno)
+ else
+ advtrains.update_driver_hud(driver:get_player_name(), self:train(), self.wagon_flipped)
+ end
end
end
end