This time, actually fix the screwdriver error

I give up trying to do this the way that is technically the right way. At least this way works, and isn't hacky.

Also, I fixed the asthetics of the chat command code a bit.
This commit is contained in:
0gb.us 2013-04-07 12:46:24 -07:00
parent 69ffe48cb8
commit 880ad992ae
2 changed files with 8 additions and 9 deletions

View File

@ -111,15 +111,15 @@ minetest.register_chatcommand("teleport", {
end,
})
minetest.chatcommands["give"] = nil
minetest.chatcommands["giveme"] = nil
minetest.chatcommands["spawnentity"] = nil
minetest.chatcommands.give = nil
minetest.chatcommands.giveme = nil
minetest.chatcommands.spawnentity = nil
if not minetest.get_modpath("logpulverize_0gb_us") then
minetest.chatcommands["pulverize"] = nil
minetest.chatcommands.pulverize = nil
end
minetest.chatcommands["rollback"] = nil
minetest.chatcommands.rollback = nil
minetest.register_chatcommand("clearobjects", {
params = "",

View File

@ -3,21 +3,20 @@ if minetest.get_modpath("screwdriver") then
local tool = minetest.registered_items["screwdriver:screwdriver"..i]
local on_use = tool.on_use
function tool.on_use(itemstack, user, pointed_thing)
local node=minetest.env:get_node(pos)
if itemstack:to_table().metadata == ""
or user:get_player_control().sneak
or pointed_thing.type ~= "node" then
screwdriver_handler(itemstack,user,pointed_thing)
return itemstack
end
local node = minetest.env:get_node(pointed_thing.below)
local node = minetest.env:get_node(pointed_thing.under)
local name = user:get_player_name()
if minetest.registered_nodes[node.name].paramtype2 ~= "facedir"
or landclaim_0gb_us.can_interact(name,pos) then
or landclaim_0gb_us.can_interact(name,pointed_thing.under) then
screwdriver_handler(itemstack,user,pointed_thing)
return itemstack
else
local owner = landclaim_0gb_us.get_owner(pointed_thing.below)
local owner = landclaim_0gb_us.get_owner(pointed_thing.under)
minetest.chat_send_player(name, "Area owned by "..owner)
return itemstack
end