Skip to content

Commit

Permalink
fix electric pole supplied counter
Browse files Browse the repository at this point in the history
* Now checks for buildings only so that robots are not counted.
  • Loading branch information
LevFendi committed May 15, 2024
1 parent cd0ebc4 commit 75b71b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ function ent_info(pindex, ent, description)
local supplied_count = 0
local producer_count = 0
for i, ent2 in ipairs(supplied_ents) do
if ent2.prototype.max_energy_usage ~= nil and ent2.prototype.max_energy_usage > 0 then
if ent2.prototype.max_energy_usage ~= nil and ent2.prototype.max_energy_usage > 0 and ent2.prototype.is_building then
supplied_count = supplied_count + 1
elseif ent2.prototype.max_energy_production ~= nil and ent2.prototype.max_energy_production > 0 then
elseif ent2.prototype.max_energy_production ~= nil and ent2.prototype.max_energy_production > 0 and ent2.prototype.is_building then
producer_count = producer_count + 1
end
end
Expand Down

0 comments on commit 75b71b7

Please sign in to comment.