[0.17.11] lamp electricity bar shows full in electric network without power

This subforum contains all the issues which we already resolved.
Post Reply
dorfl
Inserter
Inserter
Posts: 44
Joined: Mon May 28, 2018 12:49 am
Contact:

[0.17.11] lamp electricity bar shows full in electric network without power

Post by dorfl »

Lamp energy shows as full when part of an unpowered electric network.
  • Place the lamp outside an electric network -- no-power icon flashes and electricity bar is zero. As expected.
  • Place an unpowered electric pole next to the lamp -- no power icon continues to flash, but now electricity bar is full. Unexpected!
lamp-energy.png
lamp-energy.png (311.98 KiB) Viewed 2501 times
Fwiw, logging LuaEntity.energy for the lamp it jumps to energy == electric_buffer_size as soon as the power pole is placed.

Opposite problem a while back? viewtopic.php?t=54589

tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.11] lamp electricity bar shows full in electric network without power

Post by tehfreek »

Technically it doesn't consume any during the daytime, so its power needs are completely satisfied.

Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [0.17.11] lamp electricity bar shows full in electric network without power

Post by Dominik »

This is for whoever finds this (Kovarex) as the bug goes to depths that I do not want to stir up.

Image

This is a result of some lamp optimisations but the code has some weird stuff in it, the behavior indeed is wrong.
The bar is set from Lamp::getAvailableEnergy where it says

Code: Select all

return this->calculatePerformance(1 /* disabled value is one, so it shows full bar when disabled or during day */) *
If the intention was to have a full bar, then it should be fill with or without a power network. The functions this calls are weird and I don't get it.

Twinsen
Factorio Staff
Factorio Staff
Posts: 1330
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [0.17.11] lamp electricity bar shows full in electric network without power

Post by Twinsen »

Fixed in Version: 0.17.24.
Thanks.

Post Reply

Return to “Resolved Problems and Bugs”