Skip to content

Commit

Permalink
Ensure all maps get local record and karma information linked in memo…
Browse files Browse the repository at this point in the history
…ry. (#1174)
  • Loading branch information
TheMaximum committed May 22, 2022
1 parent e150fac commit e687b37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pyplanet/apps/contrib/karma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ async def load_map_votes(self, map=None):
)

# Group by map.
# Make sure all maps have an entry in the dictionary.
for list_map_id in maps:
map_karmas[list_map_id] = list()

for row in rows:
if row.map_id not in map_karmas:
map_karmas[row.map_id] = list()
map_karmas[row.map_id].append(row)

# Map karma stats.
Expand Down
6 changes: 4 additions & 2 deletions pyplanet/apps/contrib/local_records/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ async def load_map_locals(self, map=None):
)

# Group by map.
# Make sure all maps have an entry in the dictionary.
for list_map_id in maps:
map_locals[list_map_id] = list()

for row in rows:
if row.map_id not in map_locals:
map_locals[row.map_id] = list()
map_locals[row.map_id].append(row)

# Map local stats.
Expand Down

0 comments on commit e687b37

Please sign in to comment.