Fix translation nonsense in minetest.log

.. and document the armor warning when used with skinsdb
This commit is contained in:
SmallJoker 2021-03-24 19:21:39 +01:00
parent 583dfe7b21
commit e75af55f7e
2 changed files with 6 additions and 3 deletions

@ -638,17 +638,19 @@ end
armor.get_valid_player = function(self, player, msg)
msg = msg or ""
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
end
local name = player:get_player_name()
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
end
local inv = minetest.get_inventory({type="detached", name=name.."_armor"})
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
end
return name, inv

@ -331,6 +331,7 @@ minetest.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
minetest.after(0, function()
-- TODO: Added in 7566ecc - What's the prupose?
local pplayer = minetest.get_player_by_name(player_name)
if pplayer and init_player_armor(pplayer) == false then
pending_players[pplayer] = 0