When you provide nil in setUnitLoadout array for backpack slot, the engine still deletes and re-creates old backpack. This is an issue because assemble-able backpacks hold link to vehicles they assemble and this means the vehicle will be created anew and all its previous states like damage, ammo, variables will be lost.
Description
Description
Details
Details
- Severity
- None
- Resolution
- Open
- Reproducibility
- N/A
- Operating System
- Windows 10 x64
- Category
- Scripting
Steps To Reproduce
- Start playing
- Execute in debug console:
if(backpack player == "") then {player addBackpack "Bag_Base"}; oldBP = backpackContainer player; systemChat str ["oldBP", oldBP]; l = getUnitLoadout player; l set [5, nil]; player setUnitLoadout l; newBP = backpackContainer player; systemChat str ["newBP", newBP]; systemChat str ["newBP == oldBP", newBP == oldBP];
- Observer newBP == oldBP being false