Power Overload


Performant, semi-realistic power distribution overhaul. Power poles can explode if the total electrical consumption on the network is too high. Use transformers to separate networks so that subnetworks do not take more power than they can handle.

Content
1 year, 2 months ago
1.1
3.07K
Power

b [Fixed-1.2.0] #max_consumptions is 0 in reset_global_poles

2 years ago

on_init calls reset_global_poles()
but in reset_global_poles the length of max_consumptions is 0 (no entries).

I found this after adding the mod to a saved game and wondered why the small poles are not exploding :D
It turned out that the reset_global_poles function operates on a empty max_consumptions table.
I hacked it working by adding line 363 to 366 after line 344 in control.lua.
Then it works and global.poles contains the poles :-)
https://imgur.com/a/HID4ry9 (note the light pink squares (exploded small power poles))

1 year, 11 months ago
(updated 1 year, 11 months ago)

Thanks for reporting and diagnosing this problem! I guess that I'd assumed that on_load was always called whereas actually it isn't called when on_init is. The broken behaviour fixed itself by saving, changing any startup setting or the list of installed mods, and loading.

Fixed in 1.2.0.

New response