CheeseshireCat wrote...
The item will get unacquired when switching if you have little free space due to full and/or cluttered inventory.
Remember, when switching weapons, you unequip first, equip later. So if, for example, you had an axe (2x3) and a great shield (2x4) equipped, but due to some reason needed to switch to, say, a quarterstaff (1x4), if you don't have free 2x3 space, and 2x4 after that, the shield and maybe even axe would get dropped. Then the staff gets equipped, then you destroy the axe, then try to push it in again. If there still isn't room, it could mess things up even more.
How I would go about it is to replace the whole standard disarm script instead of trying to hotfix its results on the fly.
That's why I put the infinite loop check in. So even if a player switches weapons(And only a weapon and while in combat) and there is no room in the inventory, it will drop to the ground, the unacquire fires, the weapon wil try once to be recreated in the inventory, if there is no room the new one will drop to the ground and stay there as it normaly would if the inventory was too full.
It's been working for us in our meager pw.