mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-22 20:43:43 +01:00
Fix translation nonsense in minetest.log
.. and document the armor warning when used with skinsdb
This commit is contained in:
parent
583dfe7b21
commit
e75af55f7e
@ -638,17 +638,19 @@ end
|
|||||||
armor.get_valid_player = function(self, player, msg)
|
armor.get_valid_player = function(self, player, msg)
|
||||||
msg = msg or ""
|
msg = msg or ""
|
||||||
if not player then
|
if not player then
|
||||||
minetest.log("warning", S("3d_armor: Player reference is nil @1", msg))
|
minetest.log("warning", ("3d_armor%s: Player reference is nil"):format(msg))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if not name then
|
if not name then
|
||||||
minetest.log("warning", S("3d_armor: Player name is nil @1", msg))
|
minetest.log("warning", ("3d_armor%s: Player name is nil"):format(msg))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
local inv = minetest.get_inventory({type="detached", name=name.."_armor"})
|
||||||
if not inv then
|
if not inv then
|
||||||
minetest.log("warning", S("3d_armor: Detached armor inventory is nil @1", msg))
|
-- This check may fail when called inside `on_joinplayer`
|
||||||
|
-- in that case, the armor will be initialized/updated later on
|
||||||
|
minetest.log("warning", ("3d_armor%s: Detached armor inventory is nil"):format(msg))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return name, inv
|
return name, inv
|
||||||
|
@ -331,6 +331,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
|
||||||
minetest.after(0, function()
|
minetest.after(0, function()
|
||||||
|
-- TODO: Added in 7566ecc - What's the prupose?
|
||||||
local pplayer = minetest.get_player_by_name(player_name)
|
local pplayer = minetest.get_player_by_name(player_name)
|
||||||
if pplayer and init_player_armor(pplayer) == false then
|
if pplayer and init_player_armor(pplayer) == false then
|
||||||
pending_players[pplayer] = 0
|
pending_players[pplayer] = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user