mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-02-19 03:30:22 +01:00
add mob check for mob_reset_stick
This commit is contained in:
parent
1de0c34283
commit
7179dc86e6
@ -242,6 +242,7 @@ minetest.register_tool(":mobs:mob_reset_stick", {
|
|||||||
local control = user:get_player_control()
|
local control = user:get_player_control()
|
||||||
local sneak = control and control.sneak
|
local sneak = control and control.sneak
|
||||||
|
|
||||||
|
-- spawn same mob with saved stats, with random texture
|
||||||
if obj and not sneak then
|
if obj and not sneak then
|
||||||
|
|
||||||
local self = obj:get_luaentity()
|
local self = obj:get_luaentity()
|
||||||
@ -269,6 +270,7 @@ minetest.register_tool(":mobs:mob_reset_stick", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- display form to enter texture name ending in .png
|
||||||
if obj and sneak then
|
if obj and sneak then
|
||||||
|
|
||||||
tex_obj = obj
|
tex_obj = obj
|
||||||
@ -294,7 +296,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
|
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
||||||
if not tex_obj then
|
-- does mob still exist?
|
||||||
|
if not tex_obj
|
||||||
|
or not tex_obj:get_luaentity() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user