[1.1.70] on_built_entity reports incorrect belt_to_ground_type when dragging backwards
Posted: Wed Oct 19, 2022 4:31 am
I have a script that I add to control.lua while watching replays to dump what players are doing to the log to be able to simulate other players taking actions.
When players drag a belt backwards (e.g. the belt is pointing right but the player is dragging left) and it makes an underground belt, the "belt_to_ground_type" property is reversed on the underground belts in the "created_entity" in the "on_built_entity" event. In the example of dragging left, the right one is reported as an input while the left one is reported as an output. You can recreate this by running this script and dragging a belt backwards through an obstacle:
Video demonstrating
When players drag a belt backwards (e.g. the belt is pointing right but the player is dragging left) and it makes an underground belt, the "belt_to_ground_type" property is reversed on the underground belts in the "created_entity" in the "on_built_entity" event. In the example of dragging left, the right one is reported as an input while the left one is reported as an output. You can recreate this by running this script and dragging a belt backwards through an obstacle:
Code: Select all
/c script.on_event(defines.events.on_built_entity,
function(event)
if event.created_entity.type == "underground-belt" then
game.print("pos = " ..serpent.line(event.created_entity.position) .. ", belt_to_ground_type = " .. event.created_entity.belt_to_ground_type)
end
end
)