Browse Source

Corrige avertissement sur variable globale

master
sys4-fr 1 year ago
parent
commit
63d339a686
2 changed files with 6 additions and 7 deletions
  1. +1
    -3
      init.lua
  2. +5
    -4
      tools.lua

+ 1
- 3
init.lua View File

@@ -12,6 +12,4 @@ dofile(minetest.get_modpath("spears").."/functions.lua")
dofile(minetest.get_modpath("spears").."/tools.lua")


if minetest.setting_get("log_mods") then
minetest.log("action", "spears loaded")
end
minetest.log("action", "[spears] loaded.")

+ 5
- 4
tools.lua View File

@@ -2,7 +2,7 @@ function spears_register_spear(kind, desc, eq, toughness, material)

minetest.register_tool("spears:spear_" .. kind, {
description = desc .. " spear",
wield_image = "spears_spear_" .. kind .. ".png",
wield_image = "spears_spear_" .. kind .. ".png",
inventory_image = "spears_spear_" .. kind .. ".png^[transform4",
wield_scale= {x=2,y=1,z=1},
on_drop = function(itemstack, user, pointed_thing)
@@ -29,9 +29,10 @@ function spears_register_spear(kind, desc, eq, toughness, material)
}
})
SPEAR_ENTITY=spears_set_entity(kind, eq, toughness)
minetest.register_entity("spears:spear_" .. kind .. "_entity", SPEAR_ENTITY)
minetest.register_entity(
"spears:spear_" .. kind .. "_entity",
spears_set_entity(kind, eq, toughness)
)
minetest.register_craft({
output = 'spears:spear_' .. kind,

Loading…
Cancel
Save