Page 1 of 1

[1.1.101] Ghost poles have copper wires in circuit_connection_definitions

Posted: Sun Feb 04, 2024 6:10 am
by SupplyDepoo
Electric poles ghosts include copper cable connections in circuit_connection_definitions :: array[CircuitConnectionDefinition]? which should contain only elements with defines.wire_type.red or defines.wire_type.green.

The same copper connections are also listed in copper_connection_definitions.

Reproduction steps:
  1. Create a new Freeplay.
  2. Ghost-place two electric poles near each other.
  3. Run the console command: /c game.print(#game.player.selected.circuit_connection_definitions)
  4. The output will be: 1
  5. After reviving the ghosts, the output will be: 0

Re: [1.1.101] Ghost poles have copper wires in circuit_connection_definitions

Posted: Sun Feb 04, 2024 11:42 am
by boskid
Thanks for the report. Issue is now fixed for 1.1.105.

I have mixed feelings about fixing this since the timeline of introduction of copper_connection_definitions (added in 1.1.89) means that there is non zero chance that some mods could be actually using this bug in some cases, but i decided that this is wrong use case as it would not disambiguate between left and right wire of a power switch ghost so it is now fixed. This issue was already gone for 2.0 since LuaEntity::circuit_connection_definitions and LuaEntity::copper_connection_definitions will simply not exist anymore (they will be replaced with something a lot better).