From 7887f59259d2e0c42933f735bd74f65e4cf88164 Mon Sep 17 00:00:00 2001 From: Floris Date: Fri, 11 Oct 2024 17:53:21 +0200 Subject: [PATCH] hats: fix --- luarules/gadgets/unit_hats.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luarules/gadgets/unit_hats.lua b/luarules/gadgets/unit_hats.lua index 0361f586549..f1c300a7827 100644 --- a/luarules/gadgets/unit_hats.lua +++ b/luarules/gadgets/unit_hats.lua @@ -115,7 +115,7 @@ function gadget:GameFrame(gf) for _, playerID in ipairs(Spring.GetPlayerList()) do local accountID = false - local playerName, _, spec, teamID, _, _, _, _, _, _, accountInfo = Spring.GetPlayerInfo(playerID, false) + local playerName, _, spec, teamID, _, _, _, _, _, accountInfo = Spring.GetPlayerInfo(playerID) if accountInfo and accountInfo.accountid then accountID = tonumber(accountInfo.accountid) end @@ -128,7 +128,7 @@ function gadget:GameFrame(gf) local unitPosX, unitPosY, unitPosZ = Spring.GetUnitPosition(unitID) if unitDefCanWearHats[unitDefID] then - + if MatchPlayer(legchamps, playerName, accountID) and UnitDefNames['cor_hat_legfn'] then local hatDefID = UnitDefNames['cor_hat_legfn'].id local unitID = Spring.CreateUnit(hatDefID, unitPosX, unitPosY, unitPosZ, 0, teamID)