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:
parent
0ef16edb23
commit
fbf0126599
14 changed files with 87 additions and 30 deletions
23
mods/ctf/ctf_otherteams/init.lua
Normal file
23
mods/ctf/ctf_otherteams/init.lua
Normal 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)
|
2
mods/ctf/ctf_otherteams/mod.conf
Normal file
2
mods/ctf/ctf_otherteams/mod.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = ctf_otherteams
|
||||
depends = ctf
|
Loading…
Add table
Add a link
Reference in a new issue