Skip to content

Commit

Permalink
hats: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruwetuin committed Oct 11, 2024
1 parent b39a09d commit 7887f59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions luarules/gadgets/unit_hats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 7887f59

Please sign in to comment.