ctf_bounties: Prevent the previous target from being selected again (#531)

This commit is contained in:
ANAND 2019-12-18 11:01:34 +05:30 committed by GitHub
parent 23e8cff2d3
commit badce26ed5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,7 +60,7 @@ local function bounty_find_new_target()
local players = {}
for _, player in pairs(minetest.get_connected_players()) do
local name = player:get_player_name()
if ctf_stats.is_pro(name) then
if ctf_stats.is_pro(name) and name ~= bountied_player then
table.insert(players, name)
end
end
@ -75,8 +75,7 @@ minetest.after(math.random(500, 1000), bounty_find_new_target)
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
if bountied_player and
bountied_player ~= name then
if bountied_player and bountied_player ~= name then
announce(name)
end
end)