diff options
author | BremaWeb <brandon@bremaweb.com> | 2013-11-30 19:45:43 -0600 |
---|---|---|
committer | BremaWeb <brandon@bremaweb.com> | 2013-11-30 19:45:43 -0600 |
commit | bf2f311f21a4a7fd24148aa57f415d2ad6d67562 (patch) | |
tree | 151902ae06ff0cbed9065d669220e2f143be1ed4 | |
parent | 81a12e3d38c83eacfce4a3eeaec14724dcdb4c8f (diff) |
swap parameters for all calls to can_interact
-rw-r--r-- | bucket.lua | 6 | ||||
-rw-r--r-- | chest.lua | 6 | ||||
-rw-r--r-- | default.lua | 2 | ||||
-rw-r--r-- | doors.lua | 2 | ||||
-rw-r--r-- | fire.lua | 16 | ||||
-rw-r--r-- | screwdriver.lua | 2 | ||||
-rw-r--r-- | shared_door.lua | 8 | ||||
-rw-r--r-- | snow.lua | 2 |
8 files changed, 22 insertions, 22 deletions
@@ -14,7 +14,7 @@ if minetest.get_modpath("bucket") then liquiddef = bucket.liquids[n.name] if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then local player = user:get_player_name() - if landrush.can_interact(player, pointed_thing.under) then + if landrush.can_interact(pointed_thing.under, player) then minetest.env:add_node(pointed_thing.under, {name="air"}) return {name=liquiddef.itemname} else @@ -36,13 +36,13 @@ if minetest.get_modpath("bucket") then n = minetest.env:get_node(pointed_thing.under) local player = user:get_player_name() if minetest.registered_nodes[n.name].buildable_to then - if landrush.can_interact(player, pointed_thing.under) then + if landrush.can_interact(pointed_thing.under, player) then return on_use(itemstack, user, pointed_thing) else minetest.chat_send_player(player, "Area owned by "..landrush.get_owner(pointed_thing.above)) end else - if landrush.can_interact(player, pointed_thing.above) then + if landrush.can_interact(pointed_thing.above, player) then return on_use(itemstack, user, pointed_thing) else minetest.chat_send_player(player, "Area owned by "..landrush.get_owner(pointed_thing.above)) @@ -24,7 +24,7 @@ minetest.register_node("landrush:shared_chest", { allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) local meta = minetest.get_meta(pos) - if not landrush.can_interact(player:get_player_name(),pos) then + if not landrush.can_interact(pos,player:get_player_name()) then minetest.log("action", player:get_player_name() .. " tried to access a shared chest at ".. minetest.pos_to_string(pos)) return 0 end @@ -33,7 +33,7 @@ minetest.register_node("landrush:shared_chest", { allow_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) - if not landrush.can_interact(player:get_player_name(),pos) then + if not landrush.can_interact(pos,player:get_player_name()) then minetest.log("action", player:get_player_name() .. " tried to access a shared chest at ".. minetest.pos_to_string(pos)) return 0 end @@ -42,7 +42,7 @@ minetest.register_node("landrush:shared_chest", { allow_metadata_inventory_take = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) - if not landrush.can_interact(player:get_player_name(),pos) then + if not landrush.can_interact(pos,player:get_player_name()) then minetest.log("action", player:get_player_name().. " tried to access a shared chest at ".. minetest.pos_to_string(pos)) diff --git a/default.lua b/default.lua index 5285967..926da20 100644 --- a/default.lua +++ b/default.lua @@ -28,7 +28,7 @@ if minetest.get_modpath("default") then on_receive_fields = function(pos, formname, fields, sender) --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields)) local name = sender:get_player_name() - if landrush.can_interact(name, pos) then + if landrush.can_interact(pos, name) then local meta = minetest.env:get_meta(pos) fields.text = fields.text or "" print((name or "").." wrote \""..fields.text.. @@ -6,7 +6,7 @@ if minetest.get_modpath("doors") then local bottom = pointed_thing.above local top = {x=pointed_thing.above.x, y=pointed_thing.above.y+1, z=pointed_thing.above.z} local name = placer:get_player_name() - if landrush.can_interact(name, top) and landrush.can_interact(name, bottom) then + if landrush.can_interact(top,name) and landrush.can_interact(bottom, name) then return on_place(itemstack, placer, pointed_thing) else topowner = landrush.get_owner(top) @@ -2,14 +2,14 @@ if minetest.get_modpath("fire") then landrush.default_flame_should_extinguish = fire.flame_should_extinguish function fire.flame_should_extinguish(pos) - corner0 = landrush.can_interact("-!-", {x=pos.x-1,y=pos.y-1,z=pos.z-1}) - corner1 = landrush.can_interact("-!-", {x=pos.x-1,y=pos.y-1,z=pos.z+1}) - corner2 = landrush.can_interact("-!-", {x=pos.x-1,y=pos.y+1,z=pos.z-1}) - corner3 = landrush.can_interact("-!-", {x=pos.x-1,y=pos.y+1,z=pos.z+1}) - corner4 = landrush.can_interact("-!-", {x=pos.x+1,y=pos.y-1,z=pos.z-1}) - corner5 = landrush.can_interact("-!-", {x=pos.x+1,y=pos.y-1,z=pos.z+1}) - corner6 = landrush.can_interact("-!-", {x=pos.x+1,y=pos.y+1,z=pos.z-1}) - corner7 = landrush.can_interact("-!-", {x=pos.x+1,y=pos.y+1,z=pos.z+1}) + corner0 = landrush.can_interact({x=pos.x-1,y=pos.y-1,z=pos.z-1},"-!-") + corner1 = landrush.can_interact({x=pos.x-1,y=pos.y-1,z=pos.z+1},"-!-") + corner2 = landrush.can_interact({x=pos.x-1,y=pos.y+1,z=pos.z-1},"-!-") + corner3 = landrush.can_interact({x=pos.x-1,y=pos.y+1,z=pos.z+1},"-!-") + corner4 = landrush.can_interact({x=pos.x+1,y=pos.y-1,z=pos.z-1},"-!-") + corner5 = landrush.can_interact({x=pos.x+1,y=pos.y-1,z=pos.z+1},"-!-") + corner6 = landrush.can_interact({x=pos.x+1,y=pos.y+1,z=pos.z-1},"-!-") + corner7 = landrush.can_interact({x=pos.x+1,y=pos.y+1,z=pos.z+1},"-!-") if corner0 and corner1 then return landrush.default_flame_should_extinguish(pos) else diff --git a/screwdriver.lua b/screwdriver.lua index 079d65c..75d9c21 100644 --- a/screwdriver.lua +++ b/screwdriver.lua @@ -38,7 +38,7 @@ function safe_screwdriver_handler (itemstack,user,pointed_thing) if pointed_thing.type~="node" then return end local pos=minetest.get_pointed_thing_position(pointed_thing,above) -- Landrush fix - if not landrush.can_interact( player_name, pos ) then + if not landrush.can_interact( pos, player_name ) then return nil end -- end fix diff --git a/shared_door.lua b/shared_door.lua index a876485..ec9f8fb 100644 --- a/shared_door.lua +++ b/shared_door.lua @@ -36,13 +36,13 @@ minetest.register_craft({ minetest.registered_nodes['landrush:shared_door_b_1'].on_rightclick = function(pos, node, clicker) -if ( landrush.can_interact(clicker:get_player_name(),pos) ) then +if ( landrush.can_interact(pos,clicker:get_player_name()) ) then landrush.on_rightclick(pos, 1, "landrush:shared_door_t_1", "landrush:shared_door_b_2", "landrush:shared_door_t_2", {1,2,3,0}) end end minetest.registered_nodes['landrush:shared_door_t_1'].on_rightclick = function(pos, node, clicker) -if ( landrush.can_interact(clicker:get_player_name(),pos) ) then +if ( landrush.can_interact(pos,clicker:get_player_name()) ) then landrush.on_rightclick(pos, -1, "landrush:shared_door_b_1", "landrush:shared_door_t_2", "landrush:shared_door_b_2", {1,2,3,0}) end end @@ -51,13 +51,13 @@ end -- Bug was caused, because the reverse order of the on_rightclick was not taken into account minetest.registered_nodes['landrush:shared_door_b_2'].on_rightclick = function(pos, node, clicker) -if ( landrush.can_interact(clicker:get_player_name(),pos) ) then +if ( landrush.can_interact(pos,clicker:get_player_name()) ) then landrush.on_rightclick(pos, 1, "landrush:shared_door_t_2", "landrush:shared_door_b_1", "landrush:shared_door_t_1", {3,0,1,2}) end end minetest.registered_nodes['landrush:shared_door_t_2'].on_rightclick = function(pos, node, clicker) -if ( landrush.can_interact(clicker:get_player_name(),pos) ) then +if ( landrush.can_interact(pos,clicker:get_player_name()) ) then landrush.on_rightclick(pos, -1, "landrush:shared_door_b_2", "landrush:shared_door_t_1", "landrush:shared_door_b_1", {3,0,1,2}) end end @@ -16,7 +16,7 @@ if minetest.get_modpath( 'snow' ) then if self.lastpos.x~=nil then if node.name ~= "air" then - if landrush.can_interact( ' ', pos ) then + if landrush.can_interact( pos, ' ' ) then snow.place(pos) end self.object:remove() |