@@ -1028,8 +1028,11 @@ def load_players(self):
1028
1028
player .structures_razed = stats .get ('Structures Razed Count' , None )
1029
1029
1030
1030
# Graphs Tab
1031
+ # Keep income_graph for backwards compatibility
1031
1032
player .army_graph = stats .get ('Army Value' )
1032
- player .income_graph = stats .get ('Resource Collection Rate' , None )
1033
+ player .resource_collection_graph = stats .get ('Resource Collection Rate' , None )
1034
+ player .income_graph = player .resource_collection_graph
1035
+
1033
1036
1034
1037
# HotS Stats
1035
1038
# TODO: Add the XP stats?
@@ -1045,13 +1048,13 @@ def load_players(self):
1045
1048
player .apm = stats .get ('APM' , None )
1046
1049
1047
1050
# Economic Breakdown Tab
1048
- if isinstance (player .income_graph , Graph ):
1049
- # TODO: Is this algorithm right?
1050
- values = player .income_graph .values
1051
- player .income_rate = sum (values )/ len (values )
1051
+ if isinstance (player .resource_collection_graph , Graph ):
1052
+ values = player .resource_collection_graph .values
1053
+ player .resource_collection_rate = sum (values )/ len (values )
1052
1054
else :
1053
1055
# In old s2gs files the field with this name was actually a number not a graph
1054
- player .income_rate = player .income_graph
1056
+ player .resource_collection_rate = player .resource_collection_graph
1057
+ player .resource_collection_graph = None
1055
1058
player .income_graph = None
1056
1059
1057
1060
player .avg_unspent_resources = stats .get ('Average Unspent Resources' , None )
0 commit comments