forked from LizzyFleckenstein03/Memeclone
Limit mob name length to 80 chars on renaming
This commit is contained in:
parent
01049a52fd
commit
bd23bb956a
|
@ -3056,8 +3056,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local mobname
|
||||||
|
if string.len(fields.name) > 80 then
|
||||||
|
minetest.chat_send_player(name, "Warning: Your chosen name is very long! It has been shortened to 80 characters.")
|
||||||
|
mobname = string.sub(fields.name, 1, 80)
|
||||||
|
end
|
||||||
|
|
||||||
-- update nametag
|
-- update nametag
|
||||||
mob_obj[name].nametag = fields.name
|
mob_obj[name].nametag = mobname
|
||||||
|
|
||||||
update_tag(mob_obj[name])
|
update_tag(mob_obj[name])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue