Fix a load of issues, add luacheck and travis

This commit is contained in:
rubenwardy 2018-04-06 14:04:56 +01:00
parent c21b192f82
commit 7bd82dca86
28 changed files with 144 additions and 107 deletions

View file

@ -13,9 +13,9 @@ function ctf_team_base.place(color, pos)
for y = pos.y, pos.y + 3 do
for x = pos.x - 3, pos.x + 3 do
for z = pos.z - 3, pos.z + 3 do
local pos = {x=x, y=y, z=z}
if minetest.get_node(pos).name == "default:tree" then
minetest.set_node(pos, {name="air"})
local pos2 = {x=x, y=y, z=z}
if minetest.get_node(pos2).name == "default:tree" then
minetest.set_node(pos2, {name="air"})
end
end
end
@ -28,13 +28,13 @@ function ctf_team_base.place(color, pos)
dz = -2
chest.param2 = minetest.dir_to_facedir({x=0,y=0,z=-1})
end
local pos = {
local pos3 = {
x = pos.x,
y = pos.y,
z = pos.z + dz
}
minetest.set_node(pos, chest)
local inv = minetest.get_meta(pos):get_inventory()
minetest.set_node(pos3, chest)
local inv = minetest.get_meta(pos3):get_inventory()
inv:add_item("main", ItemStack("default:cobble 99"))
inv:add_item("main", ItemStack("default:cobble 99"))
inv:add_item("main", ItemStack("default:cobble 99"))

View file

@ -90,7 +90,6 @@ for _, chest_color in pairs(colors) do
allow_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if chest_color ~= ctf.player(player:get_player_name()).team then
minetest.chat_send_player(player:get_player_name(), "You're not on team " .. chest_color)
return 0
@ -125,7 +124,6 @@ for _, chest_color in pairs(colors) do
end
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if chest_color ~= ctf.player(player:get_player_name()).team then
minetest.chat_send_player(player:get_player_name(), "You're not on team " .. chest_color)
return 0