Skip to content

Commit

Permalink
Only a 3-year-old would make this kind of mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
a-blob committed Nov 23, 2023
1 parent 64a7f3d commit d040d43
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mods/ctf/ctf_combat/ctf_combat_mode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ local healers = {}

ctf_combat_mode = {}

local suffocation_message = ""

local function update(player)
local combat = hitters[player]

Expand All @@ -16,7 +14,7 @@ local function update(player)
end

local hud_message = "You are in combat [%ds left] \n%s"
hud_message = hud_message:format(combat.time, suffocation_message)
hud_message = hud_message:format(combat.time, combat.suffocation_message)

if hud:exists(player, "combat_indicator") then
hud:change(player, "combat_indicator", {
Expand All @@ -38,10 +36,10 @@ local function update(player)

if node.groups.real_suffocation then -- From real_suffocation mod
combat.time = combat.time + 0.5
suffocation_message = "You are inside blocks. Move out to stop your combat timer from increasing."
combat.suffocation_message = "You are inside blocks. Move out to stop your combat timer from increasing."
else
combat.time = combat.time - 1
suffocation_message = ""
combat.suffocation_message = ""
end

combat.timer = minetest.after(1, update, player)
Expand All @@ -60,6 +58,7 @@ function ctf_combat_mode.add_hitter(player, hitter, weapon_image, time)
combat.time = time
combat.last_hitter = hitter
combat.weapon_image = weapon_image
combat.suffocation_message = ""

if not combat.timer then
update(player)
Expand Down

0 comments on commit d040d43

Please sign in to comment.