mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-02-14 09:20:25 +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 sneak = control and control.sneak
|
||||
|
||||
-- spawn same mob with saved stats, with random texture
|
||||
if obj and not sneak then
|
||||
|
||||
local self = obj:get_luaentity()
|
||||
@ -269,6 +270,7 @@ minetest.register_tool(":mobs:mob_reset_stick", {
|
||||
end
|
||||
end
|
||||
|
||||
-- display form to enter texture name ending in .png
|
||||
if obj and sneak then
|
||||
|
||||
tex_obj = obj
|
||||
@ -294,7 +296,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user