[2.0.71] Power poles rewiring in reponse to can_place_entity

This subforum contains all the issues which we already resolved.
Gweneph
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Thu Nov 14, 2019 11:51 pm
Contact:

[2.0.71] Power poles rewiring in reponse to can_place_entity

Post 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 254 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.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4254
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post 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.
Post Reply

Return to “Resolved Problems and Bugs”