mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
Correct splash potions with no executable function
This commit is contained in:
parent
4a654fccc4
commit
10f2dcb53a
@ -51,17 +51,21 @@ local function register_potion(def)
|
|||||||
local function get_splash_fun(effect, sp_dur)
|
local function get_splash_fun(effect, sp_dur)
|
||||||
if def.is_dur then
|
if def.is_dur then
|
||||||
return function(player, redx) def.on_use(player, effect, sp_dur*redx) end
|
return function(player, redx) def.on_use(player, effect, sp_dur*redx) end
|
||||||
else
|
elseif def.effect then
|
||||||
return function(player, redx) def.on_use(player, effect*redx, sp_dur) end
|
return function(player, redx) def.on_use(player, effect*redx, sp_dur) end
|
||||||
end
|
end
|
||||||
|
-- covers case of no effect (water, awkward, mundane)
|
||||||
|
return function() end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_lingering_fun(effect, sp_dur)
|
local function get_lingering_fun(effect, sp_dur)
|
||||||
if def.is_dur then
|
if def.is_dur then
|
||||||
return function(player, redx) def.on_use(player, effect, sp_dur) end
|
return function(player) def.on_use(player, effect, sp_dur) end
|
||||||
else
|
elseif def.effect then
|
||||||
return function(player, redx) def.on_use(player, effect*0.5, sp_dur) end
|
return function(player) def.on_use(player, effect*0.5, sp_dur) end
|
||||||
end
|
end
|
||||||
|
-- covers case of no effect (water, awkward, mundane)
|
||||||
|
return function() end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_craftitem("mcl_potions:"..def.name, {
|
minetest.register_craftitem("mcl_potions:"..def.name, {
|
||||||
|
Loading…
Reference in New Issue
Block a user