diff options
author | orwell96 <orwell@bleipb.de> | 2018-10-29 16:04:36 +0100 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-10-29 16:04:36 +0100 |
commit | 9f6ae55e37141e8e446e6229132495e69b0e31ad (patch) | |
tree | f743f06b704582494283d1625efa533dd9eff99f | |
parent | c1d5fb0e8ccc30e39919a910b30d5466a84a8464 (diff) | |
download | advtrains-9f6ae55e37141e8e446e6229132495e69b0e31ad.tar.gz advtrains-9f6ae55e37141e8e446e6229132495e69b0e31ad.tar.bz2 advtrains-9f6ae55e37141e8e446e6229132495e69b0e31ad.zip |
Small fixes which do not have any effect
-rw-r--r-- | advtrains/trainlogic.lua | 1 | ||||
-rw-r--r-- | advtrains/wagons.lua | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index 15d8871..3d0b3d4 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -258,6 +258,7 @@ function advtrains.train_ensure_init(id, train) atwarn("Train",id,": Can't initialize: Waiting for the (yet unloaded) node at",train.last_pos," to be loaded.") end train.wait_for_path = true + return end -- by now, we should have a working initial path train.wait_for_path = false diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua index c532d30..1621da8 100644 --- a/advtrains/wagons.lua +++ b/advtrains/wagons.lua @@ -864,7 +864,7 @@ function wagon:handle_bordcom_fields(pname, formname, fields) local data = advtrains.wagons[self.id]
local seatno=self:get_seatno(pname)
- if not seatno or not self.seat_groups[self.seats[seatno].group].driving_ctrl_access or not advtrains.check_driving_couple_protection(pname, self.owner, self.whitelist) then
+ if not seatno or not self.seat_groups[self.seats[seatno].group].driving_ctrl_access or not advtrains.check_driving_couple_protection(pname, data.owner, data.whitelist) then
return
end
local train = self:train()
@@ -1053,7 +1053,8 @@ function wagon:seating_from_key_helper(pname, fields, no) end
end
function wagon:check_seat_group_access(pname, sgr)
- if self.seat_groups[sgr].driving_ctrl_access and not (advtrains.check_driving_couple_protection(pname, self.owner, self.whitelist)) then
+ local data = advtrains.wagons[self.id]
+ if self.seat_groups[sgr].driving_ctrl_access and not (advtrains.check_driving_couple_protection(pname, data.owner, data.whitelist)) then
return false, "Not allowed to access a driver stand!"
end
if self.seat_groups[sgr].driving_ctrl_access then
|