attempt to fix "doublescore" bug
This commit is contained in:
parent
71374344ab
commit
85449fc076
1
init.lua
1
init.lua
|
@ -41,6 +41,7 @@ arena_lib.register_minigame("the_bridge", {
|
||||||
},
|
},
|
||||||
temp_properties = {
|
temp_properties = {
|
||||||
finished = false,
|
finished = false,
|
||||||
|
scoring = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
in_game_physics = {
|
in_game_physics = {
|
||||||
|
|
|
@ -43,6 +43,9 @@ function after_goal(arena) --global because its called once outside of this file
|
||||||
gain = 2.0,
|
gain = 2.0,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
time = os.clock()
|
||||||
|
while (os.clock() < time +3) do end
|
||||||
|
arena.scoring = false
|
||||||
end
|
end
|
||||||
|
|
||||||
local goalfunc = function(pos, node, player)
|
local goalfunc = function(pos, node, player)
|
||||||
|
@ -52,6 +55,7 @@ local goalfunc = function(pos, node, player)
|
||||||
|
|
||||||
nodename = node.name
|
nodename = node.name
|
||||||
if nodename == "the_bridge:goal_area_red" then
|
if nodename == "the_bridge:goal_area_red" then
|
||||||
|
if arena.scoring then return end
|
||||||
local temp = arena.teams[arena.team_id_red].goals +1
|
local temp = arena.teams[arena.team_id_red].goals +1
|
||||||
arena.teams[arena.team_id_red].goals = temp
|
arena.teams[arena.team_id_red].goals = temp
|
||||||
if temp > 4 and arena.in_game then
|
if temp > 4 and arena.in_game then
|
||||||
|
@ -63,6 +67,7 @@ local goalfunc = function(pos, node, player)
|
||||||
after_goal(arena)
|
after_goal(arena)
|
||||||
|
|
||||||
elseif nodename == "the_bridge:goal_area_blue" then
|
elseif nodename == "the_bridge:goal_area_blue" then
|
||||||
|
if arena.scoring then return end
|
||||||
local temp = arena.teams[arena.team_id_blue].goals +1
|
local temp = arena.teams[arena.team_id_blue].goals +1
|
||||||
arena.teams[arena.team_id_blue].goals = temp
|
arena.teams[arena.team_id_blue].goals = temp
|
||||||
if temp > 4 and arena.in_game then
|
if temp > 4 and arena.in_game then
|
||||||
|
|
Loading…
Reference in New Issue