Allow more than two teams in a match at once (#724)

* Fix bugs with more than two teams

* Fix team allocation

* Fix bugz

* Fix crash

* Fix crash with crash fix
This commit is contained in:
LoneWolfHT 2020-12-25 10:37:02 -08:00 committed by GitHub
parent 0ef16edb23
commit fbf0126599
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 87 additions and 30 deletions

View file

@ -0,0 +1,23 @@
minetest.register_on_respawnplayer(function(player)
local name = player:get_player_name()
if not ctf.get_spawn(ctf.player(name).team) then
local pos
if math.random(1, 2) == 1 then
local team = ctf.team("red")
if team and team.flags[1] then
pos = vector.new(team.flags[1])
end
else
local team = ctf.team("blue")
if team and team.flags[1] then
pos = vector.new(team.flags[1])
end
end
if pos then
player:set_pos(pos)
end
end
end)

View file

@ -0,0 +1,2 @@
name = ctf_otherteams
depends = ctf