local WINSTON_SLOT = ObjID.WINSTON
local WINSTON_ARMY_OUTFIT_SLOT = ObjID.MESHSWAP_WINSTON_ARMY_OUTFIT
local WINSTON_ARMY_OCB = 1
LevelFuncs.SyncWinstonOutfits = function()
for _, winston in ipairs(TEN.Objects.GetMoveablesBySlot(WINSTON_SLOT) or {}) do
local useArmyOutfit = winston:GetOCB() == WINSTON_ARMY_OCB
for meshIndex = 0, winston:GetMeshCount() - 1 do
if useArmyOutfit then
if not winston:GetMeshSwapped(meshIndex) then
winston:SwapMesh(meshIndex, WINSTON_ARMY_OUTFIT_SLOT, meshIndex)
end
elseif winston:GetMeshSwapped(meshIndex) then
winston:UnswapMesh(meshIndex)
end
end
end
end
TEN.Logic.AddCallback(TEN.Logic.CallbackPoint.PRE_LOOP, LevelFuncs.SyncWinstonOutfits)
--Updated code: Stranger1992, 22/03/26