Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prototypes/locomotive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function locomotive:new(entity)
end

function locomotive:update()
if not self.entity.valid or not self.entity.is_headed_to_trains_front then
if not self.entity.valid then
return
end
local required_fuel=self.stack_size-self.entity.get_item_count()
Expand Down
3 changes: 3 additions & 0 deletions prototypes/rail-power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function railprototype:on_built()
end

function railprototype:connect()
if not self.entity or not self.entity.valid then
return
end
self.electricnode.disconnect_neighbour()
--connect to other rails
for _,rail in pairs(self:get_connected_powerrails()) do
Expand Down