prevent crash caused by premature load_celebration in multiplayer.

master
MisterE123 2021-02-01 20:49:15 -05:00
parent 505b895a13
commit 9994eff165
1 changed files with 6 additions and 6 deletions

View File

@ -266,17 +266,17 @@ minetest.register_globalstep(function(dtime)
gain = 2.0,
})
--count how many players are left in the arena...
local n = 0
for name, stat in pairs(arena.players) do
n = n+1
end
-- --count how many players are left in the arena...
-- local n = 0
-- for name, stat in pairs(arena.players) do
-- n = n+1
-- end
-- if we are the only player in the arena, then load celebration... you lost, but you also won,
-- whether as a singleplayer of as a leader in multiplayer
-- although, really, this code will only ever run in singleplayer, since arena_lib automatically ends multiplayer arenas that have 1 player left
if n == 1 then
if arena.mode == 'singleplayer' then--if n == 1 then
arena_lib.load_celebration('wormball', arena, pl_name)