Merge pull request #297 from t4im/fix/drill_pointed_thing

Remove reading of undefined global to fix drill drilling pointed_thing.above in combination with other badly coded mods.
This commit is contained in:
Vanessa Ezekowitz 2017-03-06 14:08:06 -05:00 committed by GitHub
commit 05dfc14fdb

View File

@ -294,7 +294,7 @@ local function mining_drill_mk2_handler(itemstack, user, pointed_thing)
end
local charge_to_take = cost_to_use(2, meta.mode)
if meta.charge >= charge_to_take then
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
local pos = minetest.get_pointed_thing_position(pointed_thing, false)
drill_dig_it(pos, user, meta.mode)
if not technic.creative_mode then
meta.charge = meta.charge - charge_to_take
@ -317,7 +317,7 @@ local function mining_drill_mk3_handler(itemstack, user, pointed_thing)
end
local charge_to_take = cost_to_use(3, meta.mode)
if meta.charge >= charge_to_take then
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
local pos = minetest.get_pointed_thing_position(pointed_thing, false)
drill_dig_it(pos, user, meta.mode)
if not technic.creative_mode then
meta.charge = meta.charge - charge_to_take
@ -346,7 +346,7 @@ minetest.register_tool("technic:mining_drill", {
end
local charge_to_take = cost_to_use(1, 1)
if meta.charge >= charge_to_take then
local pos = minetest.get_pointed_thing_position(pointed_thing, above)
local pos = minetest.get_pointed_thing_position(pointed_thing, false)
drill_dig_it(pos, user, 1)
if not technic.creative_mode then
meta.charge = meta.charge - charge_to_take