raiguard / Krastorio2

An overhaul mod for Factorio focusing on end-game technologies and moderately increased complexity.
https://mods.factorio.com/mod/Krastorio2
GNU Lesser General Public License v3.0
119 stars 49 forks source link

Tesla Coil Can be reconfigured and break #354

Closed TheRealBurgersNFries closed 8 months ago

TheRealBurgersNFries commented 1 year ago

Description

When used in tandem with Editor Extensions, the internals of the "Electrical Energy Interface" on a Tesla Coil can be reconfigured as though it was an infinity accumulator.

When a blueprint is made of such a tesla coil, when it is placed in the rest of the world, it can become a massive source of power, a massive power sink, and/or a massive source of pollution.

I'm not sure how my tesla coil wound up with the wrong settings, but when you suddenly start producing 1G/m pollution the bugs are not pleased.

image image

image

https://drive.google.com/file/d/1ts4Jamh1ZXbOCUaGGwSMzeM3TQlkcp4a/view?usp=sharing

Reproduction

  1. load attached save
  2. investigate tesla coil object
raiguard commented 1 year ago

There isn't a good fix for this. The map editor is able to do absolutely anything, so I can't prevent you from changing properties. The answer to this is "don't do that".

TheRealBurgersNFries commented 12 months ago

Could this function not check and correct the values on the tesla coil at placement time?

https://github.com/raiguard/Krastorio2/blob/555853d0ff1bd845622a601c76970dd83fcf40a1/scripts/tesla-coil.lua#L27

raiguard commented 10 months ago

Perhaps, I'll take another look when I can.

raiguard commented 8 months ago

Yeah, this isn't worth fixing, the answer is "don't do that". The editor can break things.