# 5313 - reloading firearms throws error and duplicates magazines

**URL:** <https://discourse.cataclysmdda.org/t/5313-reloading-firearms-throws-error-and-duplicates-magazines/12298>\
**Category:** The Garage\
**Created:** [July 31, 2016, 7:59pm UTC](https://discourse.cataclysmdda.org/t/5313-reloading-firearms-throws-error-and-duplicates-magazines/12298 "2016-07-31T19:59:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordHelmchen](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@LordHelmchen](https://discourse.cataclysmdda.org/u/LordHelmchen)\
**Post date:** [July 31, 2016, 7:59pm UTC](https://discourse.cataclysmdda.org/t/5313-reloading-firearms-throws-error-and-duplicates-magazines/12298/1 "2016-07-31T19:59:47Z")

</div>

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](https://github.com/CleverRaven/Cataclysm-DDA/issues/16445)

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [July 31, 2016, 10:30pm UTC](https://discourse.cataclysmdda.org/t/5313-reloading-firearms-throws-error-and-duplicates-magazines/12298/2 "2016-07-31T22:30:04Z")

</div>

Reload code was recently changed.  
I created an issue on github, because the dev who maintains reload code doesn’t browse forums much.

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/17869>

---

<div class="post-metadata">

**Author:** ![LordHelmchen](https://avatars.discourse-cdn.com/v4/letter/l/41988e/32.png) [@LordHelmchen](https://discourse.cataclysmdda.org/u/LordHelmchen)\
**Post date:** [July 31, 2016, 10:45pm UTC](https://discourse.cataclysmdda.org/t/5313-reloading-firearms-throws-error-and-duplicates-magazines/12298/3 "2016-07-31T22:45:51Z")

</div>

Thanks. I finally took the minute to make a github account, so I can report directly there myself in the future 🙂
