Skip to content

Commit

Permalink
#1362 separate category stats from unit stats
Browse files Browse the repository at this point in the history
As a result of #1363 (comment)
  • Loading branch information
micheljung authored and aeoncleanse committed Aug 5, 2016
1 parent 92c5491 commit 66f8142
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lua/sim/score.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ function ScoreThread()
}
},

blueprints = {
-- filled dynamically below
},

units = {
-- filled dynamically below
},
Expand Down Expand Up @@ -166,12 +170,12 @@ function ScoreThread()
ArmyScore[index].resources.energyover = brain:GetArmyStat("Economy_AccumExcess_Energy", 0.0).Value

for unitId, stats in brain:GetUnitStats() do
if ArmyScore[index].units[unitId] == nil then
ArmyScore[index].units[unitId] = {}
if ArmyScore[index].blueprints[unitId] == nil then
ArmyScore[index].blueprints[unitId] = {}
end

for statName, value in stats do
ArmyScore[index].units[unitId][statName] = value
ArmyScore[index].blueprints[unitId][statName] = value
end
end

Expand Down

0 comments on commit 66f8142

Please sign in to comment.