From 85449fc0768c22f6b9a258e15d0589a6bdba4cc2 Mon Sep 17 00:00:00 2001 From: chmodsayshello Date: Sat, 22 Oct 2022 18:24:00 +0000 Subject: [PATCH] attempt to fix "doublescore" bug --- init.lua | 1 + the_bridge.lua | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/init.lua b/init.lua index d19d5a4..b238b8e 100644 --- a/init.lua +++ b/init.lua @@ -41,6 +41,7 @@ arena_lib.register_minigame("the_bridge", { }, temp_properties = { finished = false, + scoring = false, }, in_game_physics = { diff --git a/the_bridge.lua b/the_bridge.lua index f64f548..a7de950 100644 --- a/the_bridge.lua +++ b/the_bridge.lua @@ -43,6 +43,9 @@ function after_goal(arena) --global because its called once outside of this file gain = 2.0, }) end + time = os.clock() + while (os.clock() < time +3) do end + arena.scoring = false end local goalfunc = function(pos, node, player) @@ -52,6 +55,7 @@ local goalfunc = function(pos, node, player) nodename = node.name if nodename == "the_bridge:goal_area_red" then + if arena.scoring then return end local temp = arena.teams[arena.team_id_red].goals +1 arena.teams[arena.team_id_red].goals = temp if temp > 4 and arena.in_game then @@ -63,6 +67,7 @@ local goalfunc = function(pos, node, player) after_goal(arena) elseif nodename == "the_bridge:goal_area_blue" then + if arena.scoring then return end local temp = arena.teams[arena.team_id_blue].goals +1 arena.teams[arena.team_id_blue].goals = temp if temp > 4 and arena.in_game then