aboutsummaryrefslogtreecommitdiff
path: root/wagons.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-12-17 12:30:29 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2016-12-17 12:30:29 +0100
commit2f799655facc799b8073355ece91f3c82f223b63 (patch)
tree1956d217d415afc2d330c46d7463d1a7f3260d11 /wagons.lua
parent072ca535bf638e474bb6f04e40b809077e6b0b8b (diff)
parent05ce694decc0653997f45fa4f9a24b40057dbd01 (diff)
downloadadvtrains-2f799655facc799b8073355ece91f3c82f223b63.tar.gz
advtrains-2f799655facc799b8073355ece91f3c82f223b63.tar.bz2
advtrains-2f799655facc799b8073355ece91f3c82f223b63.zip
Merge branch 'master' of https://github.com/orwell96/advtrains
Diffstat (limited to 'wagons.lua')
-rw-r--r--wagons.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/wagons.lua b/wagons.lua
index 8348353..ca31590 100644
--- a/wagons.lua
+++ b/wagons.lua
@@ -416,7 +416,7 @@ function wagon:get_on(clicker, seatno)
self:get_off(seatno)
end
self.seatp[seatno] = clicker:get_player_name()
- advtrains.player_to_wagon_mapping[clicker:get_player_name()]={wagon=self, seatno=seatno}
+ advtrains.player_to_train_mapping[clicker:get_player_name()]=self.train_id
clicker:set_attach(self.object, "", self.seats[seatno].attach_offset, {x=0,y=0,z=0})
clicker:set_eye_offset(self.seats[seatno].view_offset, self.seats[seatno].view_offset)
end
@@ -427,7 +427,7 @@ function wagon:get_off_plr(pname)
end
end
function wagon:get_seatno(pname)
- for no, cont in ipairs(self.seatp) do
+ for no, cont in pairs(self.seatp) do
if cont==pname then
return no
end
@@ -438,7 +438,7 @@ function wagon:get_off(seatno)
if not self.seatp[seatno] then return end
local pname = self.seatp[seatno]
local clicker = minetest.get_player_by_name(pname)
- advtrains.player_to_wagon_mapping[pname]=nil
+ advtrains.player_to_train_mapping[pname]=nil
advtrains.clear_driver_hud(pname)
if clicker then
clicker:set_detach()