0.C.17149-g6a32a9a / win / tiles / old save that has gone through a few experimentals by now
I can (U)nload firearms without problems, and ®eload empty ones. I can un- and reload magazines with bullets. I can reload a firearm with an empty magazine with bullets.
But when I ®eload a firearm that contains a magazine with another magazine (whether from inventory or an ammo pouch), an error occurs:
DEBUG: item location does not point to valid item
FUNCTION: void item_location::remove_item()
FILE: src/item_location.cpp
LINE: 546
when I continue, the magazine is added to inventory, but a copy is still in the weapon. Unloading the weapon afterwards results in the duped magazine (filled like the original to-be-unloaded ode) added to inventory and a third (empty) remaining in the gun. Once the empty mag is unloaded, the gun is finally empty…
Edit: tested with a fresh world, updated https://github.com/CleverRaven/Cataclysm-DDA/issues/16445