mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01: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