Skip to content

Commit

Permalink
Fixed a bug with minqlx.Plugin.players() where client IDs were not ma…
Browse files Browse the repository at this point in the history
…tching actual IDs. This affected !id and similar commands.
  • Loading branch information
MinoMino committed Nov 12, 2015
1 parent 48a998e commit 44babb9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/minqlx/_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def _player(client_id):

def _players():
"""A wrapper for minqlx.players_info() to make the output more usable."""
ret = []
for player in minqlx.players_info():
ret = {}
for i, player in enumerate(minqlx.players_info()):
if not player:
continue

Expand All @@ -52,7 +52,7 @@ def _players():
pass
else:
d[key] = player[key]
ret.append(d)
ret[i] = d
return ret

class NonexistentPlayerError(Exception):
Expand Down Expand Up @@ -290,7 +290,8 @@ def slay(self):

@classmethod
def all_players(cls):
return [cls(i, player_dict=pd) for i, pd in enumerate(_players()) if pd]
players = _players()
return [cls(cid, player_dict=players[cid]) for cid in players]

class AbstractDummyPlayer(Player):
def __init__(self):
Expand Down

0 comments on commit 44babb9

Please sign in to comment.