Skip to content

Commit

Permalink
AFK Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-budd committed Oct 27, 2024
1 parent a1edba4 commit 5c7bc35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Lua/Hooks/HUD/Drawers/afktimeout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local function HUD_AFKDrawer(v,p,c)
if not (p.mm) then return end

if p.mm.afktimer < AFK_TIMEOUT - (10*TR)+1 then return end
if p.mm.afkhelpers.timeuntilreset ~= 2*TR then return end

local flash = ((leveltime%(2*TR)) < 30*TR) and (leveltime/5 & 1) and V_REDMAP or 0
local y = 120
Expand Down
6 changes: 5 additions & 1 deletion src/Lua/Hooks/HUD/Drawers/rankings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ local TILEHEIGHT = 16
local TILEMARGIN = 4
local ROWLENGTH = 300 / TILEWIDTH

local function isDead(p)
--TODO: spectators and innocents during showdown always know the role
-- of other people

--if shouldialwaysknow is true,
local function isDead(p,shouldialwaysknow)
-- print("death", (not (p and p.mo and p.mo.valid)), p.spectator, p.mo.health <= 0)
if p.mm and p.mm.joinedmidgame then
return true
Expand Down
3 changes: 3 additions & 0 deletions src/Lua/Hooks/Player/Scripts/AFKHandle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ return function(p)

if afk.timedout
or (MM_N.waiting_for_players)
or (MM_N.gameover)
or (p.mm.spectator)
p.mm.afktimer = 0
return
end

Expand Down

0 comments on commit 5c7bc35

Please sign in to comment.