mirror of
https://github.com/LoneWolfHT/grenades.git
synced 2024-11-22 06:43:45 +01:00
Grenade nodes are no longer walkable. No more infinite grenades when not in creative
This commit is contained in:
parent
a20795e6b8
commit
536a9a309d
16
init.lua
16
init.lua
@ -14,7 +14,6 @@ local function throw_grenade(name, player)
|
||||
end
|
||||
|
||||
function grenades.register_grenade(name, def)
|
||||
minetest.log("\n\n\nREGISTERING "..name.."\n\n\n\n")
|
||||
local grenade_entity = {
|
||||
physical = true,
|
||||
timer = 0,
|
||||
@ -55,6 +54,7 @@ function grenades.register_grenade(name, def)
|
||||
range = 4,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
@ -67,11 +67,17 @@ function grenades.register_grenade(name, def)
|
||||
local player_name = user:get_player_name()
|
||||
local inv = user:get_inventory()
|
||||
|
||||
local grenade = throw_grenade("grenades:grenade_"..name, user)
|
||||
grenade.timer = 0
|
||||
grenade.thrower_name = player_name
|
||||
if pointed_thing.type ~= "node" then
|
||||
local grenade = throw_grenade("grenades:grenade_"..name, user)
|
||||
grenade.timer = 0
|
||||
grenade.thrower_name = player_name
|
||||
|
||||
inv:remove_item("main", "grenades:grenade_"..name)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack = ""
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user