Using the setUnitLoadout command will break inventory synchronization.
Started happening in 1.60.
Description
Details
- Severity
- Major
- Resolution
- Fixed
- Reproducibility
- Always
- Operating System
- Windows 7
- Category
- Scripting
Server, and Player1
Player1 does command:
player setUnitLoadout (getUnitLoadout player)
After executing command, uniform and vest will show as empty on other machines.
e.g.:
That player sees items player = ["FirstAidKit"]
Other player sees: items cursorTarget = []
Full getUnitLoadout after executing command:
Note the difference in items in the uniform array (U_B_CombatUniform_mcam_vest) and vest (V_BandollierB_rgr)
Local Player: B - [["arifle_MXC_F","","","",["30Rnd_65x39_caseless_mag",30],[],""],[],["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""],["U_B_CombatUniform_mcam_vest",[["FirstAidKit",1],["30Rnd_65x39_caseless_mag",30,2],["Chemlight_green",1,1]]],["V_BandollierB_rgr",[["30Rnd_65x39_caseless_mag",30,3],["16Rnd_9x21_Mag",16,2],["HandGrenade",1,2],["SmokeShell",1,1],["SmokeShellGreen",1,1],["Chemlight_green",1,1]]],[],"H_HelmetCrew_B","",[],["ItemMap","","ItemRadio","ItemCompass","ItemWatch","NVGoggles"]]
Other Machine: B - [["arifle_MXC_F","","","",["30Rnd_65x39_caseless_mag",30],[],""],[],["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""],["U_B_CombatUniform_mcam_vest",[]],["V_BandollierB_rgr",[]],[],"H_HelmetCrew_B","",[],["ItemMap","","ItemRadio","ItemCompass","ItemWatch","NVGoggles"]]
Killing the player shows no items as lootable.
Event Timeline
if you execute the following on the server:
PlayerA setUnitLoadout [["arifle_Katiba_F","","","",["30Rnd_65x39_caseless_green",30],[],""],[],[],["U_I_G_resistanceLeader_F",[["FirstAidKit",3],["30Rnd_65x39_caseless_green",30,1]]],["V_TacVest_khk","30Rnd_65x39_caseless_green",30,10],["B_Carryall_khk","ToolKit",4],"H_HelmetIA","G_Tactical_Clear",["Rangefinder","","","",[],[],""],["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch","NVGoggles_OPFOR"]];
then the inventory is filled on the server machine but on the client machine vest, backpack and uniform are empty
This issue seems not to be completely fixed:
Player Setunitloadout _myloadout
This works well, but if you put your Uniform / Vest / Backpack on the Ground and reconnect, the Clothing(s) on the Ground seems to be empty. Same for other Players after reconnect.
But the server "think", the items are in these clothings (on the Ground)
It's broken again, after using this command (I tried use it from dedic) inventory replication becomes broken and stops. Only reconnect helps. Weird thing is that, command will crash replication only if array with loadout has uniform.