Fix crash when placing flag due to get_nearest_team_dist()

master
rubenwardy 2016-03-30 01:02:08 +01:00
parent 59d220f9a2
commit 9f9bfff97d
1 changed files with 3 additions and 1 deletions

View File

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