# Crafting sometimes crashes on inventory.cpp, and another bug

**URL:** https://discourse.cataclysmdda.org/t/crafting-sometimes-crashes-on-inventory-cpp-and-another-bug/1462
**Category:** The Garage
**Created:** [May 26, 2013, 4:07pm UTC](https://discourse.cataclysmdda.org/t/crafting-sometimes-crashes-on-inventory-cpp-and-another-bug/1462 "2013-05-26T16:07:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![utunnels](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/utunnels/32/81_2.png) [@utunnels](https://discourse.cataclysmdda.org/u/utunnels)
#### Post date: [May 26, 2013, 4:07pm UTC](https://discourse.cataclysmdda.org/t/crafting-sometimes-crashes-on-inventory-cpp-and-another-bug/1462/1 "2013-05-26T16:07:34Z")

</div>

I’m talking about the github repo, not 0.5 release.

It seems I can reproduce this bug.

1. Make a pointy stick
2. kill a squirrel and butcher for meat
3. light a fire (use matchbook over a heavy stick, for example)
4. make cooked meat

When the meat is done, the game crashes and the assertion message says the iterator is not decrementable, or something like that.  
The debug trace shows the error is on line 872 of inventory.cpp, and if I add a break point before that, it shows the item is “meat”.

* * *

Another bug is sometimes I can’t light anything but the message shows “you successfully light a fire”.  
This happens usually after I save and reload a game.

---

<div class="post-metadata">

### Author: ![utunnels](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/utunnels/32/81_2.png) [@utunnels](https://discourse.cataclysmdda.org/u/utunnels)
#### Post date: [May 27, 2013, 2:46pm UTC](https://discourse.cataclysmdda.org/t/crafting-sometimes-crashes-on-inventory-cpp-and-another-bug/1462/2 "2013-05-27T14:46:25Z")

</div>

Sorry for double posting.  
It seems the first problem I mentioned was quite msvc specific.

A list is not decrementable if it is empty no matter the iterator is pointing to the end or not.

---

<div class="post-metadata">

### Author: ![Soron](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soron/32/885_2.png) [@Soron](https://discourse.cataclysmdda.org/u/Soron)
#### Post date: [May 27, 2013, 9:06pm UTC](https://discourse.cataclysmdda.org/t/crafting-sometimes-crashes-on-inventory-cpp-and-another-bug/1462/3 "2013-05-27T21:06:58Z")

</div>

That’s actually concerning, although it’ll be a pain to fix. I’ll post something on the Github issue tracker.

---

<div class="post-metadata">

### Author: ![utunnels](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/utunnels/32/81_2.png) [@utunnels](https://discourse.cataclysmdda.org/u/utunnels)
#### Post date: [May 28, 2013, 12:03am UTC](https://discourse.cataclysmdda.org/t/crafting-sometimes-crashes-on-inventory-cpp-and-another-bug/1462/4 "2013-05-28T00:03:53Z")

</div>

Thank you. 🙂
