mirror of
https://github.com/louisroyer/minetest-toolranks-extras.git
synced 2024-11-04 22:53:45 +01:00
Merge pull request #10 from louisroyer/fix9
Fix crash when using hoe but not on a node
This commit is contained in:
commit
4f2c388432
4
hoe.lua
4
hoe.lua
@ -14,6 +14,10 @@ local function add_hoe(material)
|
||||
minetest.override_item(name, {
|
||||
-- we also want hoes to increase dugnodes when farming soil
|
||||
on_use = function(itemstack, user, pointed_thing, uses)
|
||||
-- if no node is pointed, the hoe cannot be used
|
||||
if pointed_thing.under == nil then
|
||||
return nil
|
||||
end
|
||||
local under = minetest.get_node(pointed_thing.under)
|
||||
-- get origin wear
|
||||
local wear = itemstack:get_wear()
|
||||
|
2
init.lua
2
init.lua
@ -3,7 +3,7 @@ local MP = minetest.get_modpath("toolranks_extras")
|
||||
toolranks_extras = {}
|
||||
|
||||
-- mod information
|
||||
toolranks_extras.mod = {version = "1.4.1", author = "Louis Royer"}
|
||||
toolranks_extras.mod = {version = "1.4.2", author = "Louis Royer"}
|
||||
|
||||
-- settings
|
||||
toolranks_extras.settings = {
|
||||
|
Loading…
Reference in New Issue
Block a user