Skip to content

Commit

Permalink
AFK kick uses role index (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
PHIDIAS0303 authored Aug 16, 2024
1 parent 0a76560 commit cec98eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/addons/afk-kick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Event.on_nth_tick(config.update_time, function()
if player.afk_time < config.afk_time
or config.admin_as_active and player.admin
or config.trust_as_active and player.online_time > config.trust_time
or config.active_role and Roles.player_has_role(player, config.active_role) then
or config.active_role and (Roles.get_player_highest_role(player).index >= Roles.get_role_from_any(config.active_role).index) then
-- Active player was found
primitives.last_active = game.tick
return
Expand Down Expand Up @@ -63,4 +63,4 @@ Event.add(defines.events.on_player_joined_game, function(event)
local player = game.get_player(event.player_index)
local frame = player.gui.screen["afk-kick"]
if frame and frame.valid then frame.destroy() end
end)
end)

0 comments on commit cec98eb

Please sign in to comment.