Skip to content

Commit

Permalink
Allow putting a time limit on carried over pro chest access
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Aug 16, 2024
1 parent 49915ca commit 8a183ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion mods/ctf/ctf_rankings/leagues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ minetest.register_on_joinplayer(function(player)
end

if rank._pro_chest then
meta:set_int("ctf_rankings:pro_chest:"..mode, 1)
if rank._pro_chest == true then
meta:set_int("ctf_rankings:pro_chest:"..mode, 1)
else
meta:set_int("ctf_rankings:pro_chest:"..mode, rank._pro_chest)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion mods/ctf/ctf_rankings/ranking_reset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ local function do_reset()
if (rank.score or 0) >= 8000 and
(rank.kills or 0) / (rank.deaths or 1) >= 1.4 and
(rank.flag_captures or 0) >= 5 then
rank._pro_chest = true
rank._pro_chest = os.time()
end

local current = mods:get_string(PLAYER_RANKING_PREFIX..pname)
Expand Down

0 comments on commit 8a183ec

Please sign in to comment.