mirror of
https://github.com/minetest-mods/technic.git
synced 2024-12-25 10:20:37 +01:00
Fix drill drilling pointed_thing.above when some other mod declares a global variable above.
This commit is contained in:
parent
99bebc8008
commit
7890ffe46b
@ -296,7 +296,7 @@ local function mining_drill_mk2_handler(itemstack, user, pointed_thing)
|
|||||||
end
|
end
|
||||||
local charge_to_take = cost_to_use(2, meta.mode)
|
local charge_to_take = cost_to_use(2, meta.mode)
|
||||||
if meta.charge >= charge_to_take then
|
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)
|
drill_dig_it(pos, user, meta.mode)
|
||||||
if not technic.creative_mode then
|
if not technic.creative_mode then
|
||||||
meta.charge = meta.charge - charge_to_take
|
meta.charge = meta.charge - charge_to_take
|
||||||
@ -319,7 +319,7 @@ local function mining_drill_mk3_handler(itemstack, user, pointed_thing)
|
|||||||
end
|
end
|
||||||
local charge_to_take = cost_to_use(3, meta.mode)
|
local charge_to_take = cost_to_use(3, meta.mode)
|
||||||
if meta.charge >= charge_to_take then
|
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)
|
drill_dig_it(pos, user, meta.mode)
|
||||||
if not technic.creative_mode then
|
if not technic.creative_mode then
|
||||||
meta.charge = meta.charge - charge_to_take
|
meta.charge = meta.charge - charge_to_take
|
||||||
@ -348,7 +348,7 @@ minetest.register_tool("technic:mining_drill", {
|
|||||||
end
|
end
|
||||||
local charge_to_take = cost_to_use(1, 1)
|
local charge_to_take = cost_to_use(1, 1)
|
||||||
if meta.charge >= charge_to_take then
|
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)
|
drill_dig_it(pos, user, 1)
|
||||||
if not technic.creative_mode then
|
if not technic.creative_mode then
|
||||||
meta.charge = meta.charge - charge_to_take
|
meta.charge = meta.charge - charge_to_take
|
||||||
|
Loading…
Reference in New Issue
Block a user