mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 09:03:01 +00:00
Update validate.lua
This commit is contained in:
parent
a0f3fb5a3d
commit
a9307d3725
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
-- Helper functions
|
-- Helper functions
|
||||||
local log_error = function(message)
|
local log_error = function(message)
|
||||||
minetest.log("error", "[-- WEA :: error --] " .. message)
|
minetest.log("error", "[-- WEA :: error --] " .. tostring(message) ..
|
||||||
|
" " .. debug.traceback())
|
||||||
end
|
end
|
||||||
|
|
||||||
-- @class validate
|
-- @class validate
|
||||||
|
@ -13,8 +14,7 @@ local validate = {}
|
||||||
-- - @returns <boolean>: True if the name is valid, false otherwise.
|
-- - @returns <boolean>: True if the name is valid, false otherwise.
|
||||||
validate.name = function(name)
|
validate.name = function(name)
|
||||||
if type(name) ~= "string" then
|
if type(name) ~= "string" then
|
||||||
log_error(tostring(name) .. " is a " .. type(name) ..
|
log_error(tostring(name) .. " is a " .. type(name) .. " not a string.\n")
|
||||||
" not a string.\n" .. debug.traceback())
|
|
||||||
return false
|
return false
|
||||||
elseif not minetest.get_player_by_name then -- Very paranoid is me
|
elseif not minetest.get_player_by_name then -- Very paranoid is me
|
||||||
log_error("minetest.get_player_by_name is not a function. THIS SHOULD NEVER HAPPEN.")
|
log_error("minetest.get_player_by_name is not a function. THIS SHOULD NEVER HAPPEN.")
|
||||||
|
|
Loading…
Reference in a new issue