mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-08-19 04:24:11 +02:00
add fake player check (#86)
This commit is contained in:
parent
04b45deec8
commit
7f20e5dcb7
@ -933,6 +933,10 @@ armor.get_valid_player = function(self, player, msg)
|
|||||||
minetest.log("warning", ("3d_armor%s: Player reference is nil"):format(msg))
|
minetest.log("warning", ("3d_armor%s: Player reference is nil"):format(msg))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if type(player) ~= "userdata" then
|
||||||
|
-- Fake player, fail silently
|
||||||
|
return
|
||||||
|
end
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if not name then
|
if not name then
|
||||||
minetest.log("warning", ("3d_armor%s: Player name is nil"):format(msg))
|
minetest.log("warning", ("3d_armor%s: Player name is nil"):format(msg))
|
||||||
|
Loading…
Reference in New Issue
Block a user