Fix crash when placing flag due to get_nearest_team_dist()

This commit is contained in:
rubenwardy 2016-03-30 01:02:08 +01:00
parent 59d220f9a2
commit 9f9bfff97d

View File

@ -49,8 +49,10 @@ end
function ctf_flag.get_nearest_team_dist(pos) function ctf_flag.get_nearest_team_dist(pos)
local flag, distSQ = ctf_flag.get_nearest(pos) local flag, distSQ = ctf_flag.get_nearest(pos)
if flag then
return flag.team, distSQ return flag.team, distSQ
end end
end
ctf.register_on_territory_query(ctf_flag.get_nearest_team_dist) ctf.register_on_territory_query(ctf_flag.get_nearest_team_dist)