Skip to content

Commit

Permalink
players.PlayerEntity: Fix reset_team_changes()
Browse files Browse the repository at this point in the history
Signed-off-by: BackRaw <[email protected]>
  • Loading branch information
BackRaw committed Dec 5, 2017
1 parent 11ae610 commit 47e57db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions addons/source-python/plugins/udm/players/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def disable_damage_protection(cls, index):
# Reset the color
player.color = WHITE

@classmethod
def reset_team_changes(cls, index):
@staticmethod
def reset_team_changes(userid):
"""Reset the team change count for the player."""
with contextlib.suppress(ValueError):
player_team_changes[PlayerEntity(index)] = 0
if userid in player_team_changes:
del player_team_changes[userid]

def tell(self, prefix, message):
"""Tell the player a prefixed chat message."""
Expand Down
2 changes: 1 addition & 1 deletion addons/source-python/plugins/udm/udm.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def client_command_filter(command, index):

delay_manager(
f'reset_team_changes_{player.userid}', delay_time * 60.0,
PlayerEntity.reset_team_changes, (player.index, )
PlayerEntity.reset_team_changes, (player.userid, )
)

# Tell the player
Expand Down

0 comments on commit 47e57db

Please sign in to comment.