forked from mtcontrib/maidroid
commit
7697bac1f0
@ -148,25 +148,25 @@ end) ()
|
|||||||
local formspec_opened_maidroids = {}
|
local formspec_opened_maidroids = {}
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
if formname ~= "maidroid:gui" then
|
if formname ~= "maidroid:gui" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local self = formspec_opened_maidroids[player]
|
local self = formspec_opened_maidroids[player]
|
||||||
if not self then -- if the maidroid is dead now.
|
if not self then -- if the maidroid is dead now.
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.name then
|
if fields.name then
|
||||||
if fields.name == "" then
|
if fields.name == "" then
|
||||||
self.nametag = self.inventory_name
|
self.nametag = self.inventory_name
|
||||||
else
|
else
|
||||||
self.nametag = fields.name
|
self.nametag = fields.name
|
||||||
end
|
end
|
||||||
self.object:set_nametag_attributes{
|
self.object:set_nametag_attributes{
|
||||||
text = self.nametag
|
text = self.nametag
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user