So, basically what I expected to happen is:
On accept action
if (backpack has space) then
unload primary clip // To keep from deleting it
place primary in backpack
if (groundholder has compatable magazines)
take compatable magazines
assign ground weapon to primary (it'll be auto-loaded)
if (backpack doesn't have required space for primary weapon)
unload primary clip
swap weapon with ground weapon // And I saw your function for variable swapping
I think any clips in the inventory associated with that weapon should be manually removed as sometimes I hoard them for other people when I have extra space.
Take note, if you don't unload it you'll have 0 ammo eventually
because when you have ammo in inventory, it auto loads it into a compatible gun
and then when you right click a gun it deletes that clip so if you had 15 clips and you right click from ground tab, you have 14 in inventory and an auto loaded primary weapon. When right clicking again clip loaded deletes itself, then you could essentially delete all your ammo by equipping and removing a weapon.
The auto loading should stay so I can make npcs come in already packing a loaded primary but for players there are too many variables that cost you ammo or an (in wasteland) possibly a very expensive rifle.
Thanks in advance, I've been learning to code lately and I've a solid appreciation for the work you all put in. =)