Page 1 of 1

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

Posted: Tue Mar 12, 2019 11:01 am
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 2477 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

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

Posted: Tue Mar 12, 2019 11:35 am
by tehfreek
Technically it doesn't consume any during the daytime, so its power needs are completely satisfied.

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

Posted: Mon Apr 01, 2019 3:43 pm
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.

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

Posted: Mon Apr 01, 2019 5:08 pm
by Twinsen
Fixed in Version: 0.17.24.
Thanks.