fix wagon-control combinator

This commit is contained in:
Harag
2024-10-22 22:32:02 +02:00
parent aaee0540ca
commit 9c3e1632c8

View File

@@ -147,10 +147,10 @@ end
---@param stop LuaEntity ---@param stop LuaEntity
---@param train LuaTrain ---@param train LuaTrain
local function get_train_direction(stop, train) local function get_train_direction(stop, train)
local back_rail = train.back_rail local back_end = train.get_rail_end(defines.rail_direction.back)
if back_rail then if back_end and back_end.rail then
local back_pos = back_rail.position local back_pos = back_end.rail.position
local stop_pos = stop.position local stop_pos = stop.position
if abs(back_pos.x - stop_pos.x) < 3 and abs(back_pos.y - stop_pos.y) < 3 then if abs(back_pos.x - stop_pos.x) < 3 and abs(back_pos.y - stop_pos.y) < 3 then
return true return true