Page 1 of 1

luaEntity.order_upgrade{} behavior differs from upgrade planner

Posted: Mon May 04, 2020 3:30 am
by Mylon
What happened:
Calling `/c game.player.selected.order_upgrade{force=game.player.force, target="fast-underground-belt"}` on an underground transport belt marks the entity for upgrade but does not mark its neighbor.
What was expected:
Calling the above command marks the entity and its connected neighbor for upgrade.

Compare to: upgrade planner only selecting one underground belt and the neighbor gets marked for upgrade as well.
To recreate:
/cheat all, get some underground belts and fast-underground belts in inventory
Build two pairs of underground belts. Upgrade planner 1 entity. Both entities in the pair get marked and robots upgrade both.
Call the above command while mousing over one of the other pairs. Only that entity gets marked and robots only upgrade that one entity.

Re: luaEntity.order_upgrade{} behavior differs from upgrade planner

Posted: Mon May 04, 2020 6:16 am
by Optera
It probably won't be a bug, in which case this could be moved to api requests.

When using order_upgrade on type="underground-belt" implicitly call order_upgrade on neighbor.
Writing the request like this I'm not sure if it's a good idea to do that.

Re: luaEntity.order_upgrade{} behavior differs from upgrade planner

Posted: Mon May 04, 2020 6:59 pm
by Rseding91
Thanks for the report however that's intended. If you want both ends done - just do both ends. It was done this way because otherwise there would be no way to do just one end through the API.