forked from mtcontrib/mobs_redo
limit mob names to 64 chars, update mount lib to new 0.4.15 functions
This commit is contained in:
7
api.lua
7
api.lua
@ -1,5 +1,5 @@
|
||||
|
||||
-- Mobs Api (24th February 2017)
|
||||
-- Mobs Api (2nd March 2017)
|
||||
|
||||
mobs = {}
|
||||
mobs.mod = "redo"
|
||||
@ -3383,6 +3383,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
return
|
||||
end
|
||||
|
||||
-- limit name entered to 64 characters long
|
||||
if string.len(fields.name) > 64 then
|
||||
fields.name = string.sub(fields.name, 1, 64)
|
||||
end
|
||||
|
||||
-- update nametag
|
||||
mob_obj[name].nametag = fields.name
|
||||
|
||||
|
Reference in New Issue
Block a user