Skip to content

Commit

Permalink
Fix crash on rightclick of orphan team chest
Browse files Browse the repository at this point in the history
Fixes #228
  • Loading branch information
rubenwardy authored Nov 10, 2018
1 parent 7ed2aab commit df0adb4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mods/ctf_team_base/chest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ for _, chest_color in pairs(colors) do

local territory_owner = ctf.get_territory_owner(pos)
if chest_color ~= territory_owner then
if not territory_owner then
ctf.warning("ctf_team_base", "Unowned team chest")
minetest.set_node(pos, { name = "air" })
return
end
ctf.warning("ctf_team_base", "Wrong chest, changing to " .. territory_owner .. " from " .. chest_color)
minetest.set_node(pos, "ctf_team_base:chest_" .. territory_owner)
end
Expand Down

0 comments on commit df0adb4

Please sign in to comment.