mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-28 07:43:01 +00:00
Limit mob name length to 80 chars on renaming
This commit is contained in:
parent
01049a52fd
commit
bd23bb956a
1 changed files with 7 additions and 1 deletions
|
@ -3056,8 +3056,14 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
return
|
||||
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
|
||||
mob_obj[name].nametag = fields.name
|
||||
mob_obj[name].nametag = mobname
|
||||
|
||||
update_tag(mob_obj[name])
|
||||
|
||||
|
|
Loading…
Reference in a new issue