fix crash on getting on wagon, caused by nonexistant table
parent
6a406505ea
commit
f6576b6a6a
|
@ -193,6 +193,9 @@ function wagon:on_step(dtime)
|
||||||
elseif not self.initialized then
|
elseif not self.initialized then
|
||||||
self.initialized=true
|
self.initialized=true
|
||||||
end
|
end
|
||||||
|
if not self.seatp then
|
||||||
|
self.seatp={}
|
||||||
|
end
|
||||||
|
|
||||||
--re-attach driver if he got lost
|
--re-attach driver if he got lost
|
||||||
--if not self.driver and self.driver_name then
|
--if not self.driver and self.driver_name then
|
||||||
|
@ -213,9 +216,6 @@ function wagon:on_step(dtime)
|
||||||
--driver control
|
--driver control
|
||||||
for seatno, seat in ipairs(self.seats) do
|
for seatno, seat in ipairs(self.seats) do
|
||||||
if seat.driving_ctrl_access then
|
if seat.driving_ctrl_access then
|
||||||
if not self.seatp then
|
|
||||||
self.seatp={}
|
|
||||||
end
|
|
||||||
local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno])
|
local driver=self.seatp[seatno] and minetest.get_player_by_name(self.seatp[seatno])
|
||||||
if driver and driver:get_player_control_bits()~=self.old_player_control_bits then
|
if driver and driver:get_player_control_bits()~=self.old_player_control_bits then
|
||||||
local pc=driver:get_player_control()
|
local pc=driver:get_player_control()
|
||||||
|
|
Loading…
Reference in New Issue