Page 1 of 1

[2.0.71] Power poles rewiring in reponse to can_place_entity

Posted: Tue Oct 21, 2025 1:06 pm
by Gweneph
Setup:
  1. Two connected substations.
  2. Disconnect them.
  3. Call LuaSurface::can_place_entity{name="substation", position=<between them>}
Expected:
substations remain disconnected after step 3.
Actual:
Substations get reconnected after step 3.
Screenshot 2025-10-21 085530.png
Screenshot 2025-10-21 085530.png (3.59 MiB) Viewed 262 times
Screenshot after I did the steps above.

This is problematic for bases with isolated power grids when mods expect to be able to query without side effects. Specific use case is FactorioAccess where we call this function frequently, but don't want to screw up someone's nicely blackout proofed base.

Re: [2.0.71] Power poles rewiring in reponse to can_place_entity

Posted: Tue Oct 21, 2025 1:19 pm
by boskid
Thanks for the report. Buildability check was not supposed to mutate game state so this was obviously an issue. Fixed for the next release.