Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USER_CMDS_PER_BUTTON_CHANGE = 15
- ...
- player_buttons = PlayerDictionary(lambda index: None)
- ...
- # in run_command hook
- if (player_buttons[player.index] is None or
- player_buttons[player.index][1] != user_cmd.buttons):
- player_buttons[player.index] = [0, user_cmd.buttons]
- return
- if player_buttons[player.index][0] < USER_CMDS_PER_BUTTON_CHANGE:
- player_buttons[player.index][0] += 1
- return
- # By now you know that the user_cmd.buttons is stable (didn't change)
- # for at least 15 executions of the run_command hook
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement