def listener_on_tick(): for sprinting_player in player_manager.values(): if sprinting_player.player.ground_entity == -1: sprinting_player.ensure_speed(AIRBORNE_PLAYER_SPEED) else: if sprinting_player.sprinting: sprinting_player.ensure_speed(SPRINTING_PLAYER_SPEED) else: sprinting_player.ensure_speed(DEFAULT_PLAYER_SPEED) if sprinting_player.sprinting: inthandle = sprinting_player.player.active_weapon if inthandle == INVALID_ENTITY_INTHANDLE: continue entity = Entity(index_from_inthandle(inthandle)) entity.next_attack = global_vars.current_time + 1 entity.next_secondary_fire_attack = global_vars.current_time + 1