# Infinite Bear Traps (experimental build)

**URL:** <https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597>\
**Category:** The Garage\
**Created:** [October 21, 2013, 6:50am UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597 "2013-10-21T06:50:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hyena\_Grin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/hyena_grin/32/894_2.png) [@Hyena\_Grin](https://discourse.cataclysmdda.org/u/Hyena_Grin)\
**Post date:** [October 21, 2013, 6:50am UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/1 "2013-10-21T06:50:55Z")

</div>

In the version of the experimental SDL build (downloaded today)…

I picked up two bear traps from a trap nest, and when I went (a)ctivated them to place them, they went onto the ground but did not get removed from my inventory. Thus I could place as many bear traps as I wanted. I tried dropping the bear trap and picking it back up, but the behavior remained.

---

<div class="post-metadata">

**Author:** ![Soviet\_Troopa](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/soviet_troopa/32/193_2.png) [@Soviet\_Troopa](https://discourse.cataclysmdda.org/u/Soviet_Troopa)\
**Post date:** [October 21, 2013, 11:20am UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/2 "2013-10-21T11:20:03Z")

</div>

same thing with other traps like caltrops and nail boards. ITS A TRAP!, INFINTE TRAPS

---

<div class="post-metadata">

**Author:** ![infectedmochi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/infectedmochi/32/206_2.png) [@infectedmochi](https://discourse.cataclysmdda.org/u/infectedmochi)\
**Post date:** [October 21, 2013, 11:56am UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/3 "2013-10-21T11:56:20Z")

</div>

Sorry, I just had to:

![](http://cdn.meme.li/i/p7mjm.jpg)

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [October 21, 2013, 3:24pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/4 "2013-10-21T15:24:30Z")

</div>

Thanks for reporting, I have a fix for this, which actually ended up being an extensive rework of the 'a’ctivate method. It’s just waiting on review and merge.

---

<div class="post-metadata">

**Author:** ![burgerpro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@burgerpro](https://discourse.cataclysmdda.org/u/burgerpro)\
**Post date:** [October 21, 2013, 8:00pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/5 "2013-10-21T20:00:43Z")

</div>

I think there is no need to create another thread then.  
You sometimes have to select the item with which you should do your action twice. Like when I want to throw a hammer into a spider i go ‘i’ → ‘F’ (letter for hammer) → ‘t’ and it instead of sending me directly to aiming mode sends me back to inventory to select which item would I like to throw. Same goes for ‘a’ and ‘d’ sometimes, didn’t yet try other builds. So far it worked on 0.8-1803 (if I am not mistaken, already removed it) and 1806 builds (throwing seems to work, but dropping and action still buggy).  
Probably will be fixed soon anyway, but maybe it’ll help.

---

<div class="post-metadata">

**Author:** ![TaintedHolyWater](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@TaintedHolyWater](https://discourse.cataclysmdda.org/u/TaintedHolyWater)\
**Post date:** [October 23, 2013, 9:37pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/6 "2013-10-23T21:37:19Z")

</div>

Burgerpro: As an alternative you can just 'T’hrow then select your weapon. I rarely if ever use the keys from inside the item’s description.

---

<div class="post-metadata">

**Author:** ![burgerpro](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@burgerpro](https://discourse.cataclysmdda.org/u/burgerpro)\
**Post date:** [October 23, 2013, 9:46pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/7 "2013-10-23T21:46:31Z")

</div>

I know but that’s still a bug.

---

<div class="post-metadata">

**Author:** ![Hyena\_Grin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/hyena_grin/32/894_2.png) [@Hyena\_Grin](https://discourse.cataclysmdda.org/u/Hyena_Grin)\
**Post date:** [October 24, 2013, 3:47am UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/8 "2013-10-24T03:47:30Z")

</div>

I am assuming this has already been found as well, but just in case;

This bug seems to be occurring as well with firearms and item modifications. I can modify a gun and the modification remains in my inventory. Just throwing it out there in case it’s helpful.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [October 24, 2013, 7:43pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/9 "2013-10-24T19:43:13Z")

</div>

Thanks, I pretty much took a hatchet to ALL the code that was involved, so it should sort that out too.

---

<div class="post-metadata">

**Author:** ![matew](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@matew](https://discourse.cataclysmdda.org/u/matew)\
**Post date:** [October 24, 2013, 8:51pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/10 "2013-10-24T20:51:54Z")

</div>

well I’ve reported this bug with traps and mods some days ago but there was no reply ☹

---

<div class="post-metadata">

**Author:** ![AVE](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@AVE](https://discourse.cataclysmdda.org/u/AVE)\
**Post date:** [October 28, 2013, 7:58pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/11 "2013-10-28T19:58:36Z")

</div>

If for whatever reason anyone is interested what is the reason of item not destroying itself after use, it is because of iuse::%whatever% returns it-\>type-\>charges\_to\_use() and for tools like roadmap, beartrap, extra battery mod, etc, this value is exactly zero in json. So, it never gets destroyed in player::use because in this code

` int charges_used = tool->use.call(g, this, used, false);
            if ( charges_used >= 1 ) {
                if( tool->charges_per_use > 0 ) {
                    used->charges -= std::min(used->charges, charges_used);
                } else {
                    // An item that doesn't normally expend charges is destroyed instead.
                    i_rem(let);
                }
            }`  
charges\_used is zero.

---

<div class="post-metadata">

**Author:** ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Post date:** [October 28, 2013, 8:01pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/12 "2013-10-28T20:01:47Z")

</div>

This has already been fixed in the current experimental.

---

<div class="post-metadata">

**Author:** ![AVE](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@AVE](https://discourse.cataclysmdda.org/u/AVE)\
**Post date:** [October 29, 2013, 5:53am UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/13 "2013-10-29T05:53:36Z")

</div>

> [@i2amroy](#):
>
> This has already been fixed in the current experimental.

For extra battery mod and roadmap it isn’t, I’ve just checked it by spawning items with debug menu and by viewing the code. The compiled version is 0.8-2188-g4b95fcd.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [October 29, 2013, 4:40pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/14 "2013-10-29T16:40:01Z")

</div>

Thanks for clarifying, I hate doppelganger bugs ☹

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [October 29, 2013, 4:46pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/15 "2013-10-29T16:46:34Z")

</div>

Last I checked, you still can’t actually deploy fur rollmats either.

It throws an error message and eats the rollmat, but places nothing on the ground.

I wish I had some idea why it was doing so, but it worked just fine when I added fur rollmats in, and only started doing this weird error post-merge.

[Git issue report.](https://github.com/CleverRaven/Cataclysm-DDA/issues/3801)

---

<div class="post-metadata">

**Author:** ![AVE](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@AVE](https://discourse.cataclysmdda.org/u/AVE)\
**Post date:** [October 29, 2013, 5:37pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/16 "2013-10-29T17:37:16Z")

</div>

[quote=“Rivet, post:15, topic:3597”]Last I checked, you still can’t actually deploy fur rollmats either.

It throws an error message and eats the rollmat, but places nothing on the ground.

I wish I had some idea why it was doing so, but it worked just fine when I added fur rollmats in, and only started doing this weird error post-merge.

[Git issue report.](https://github.com/CleverRaven/Cataclysm-DDA/issues/3801)[/quote]  
Because in iuse::set\_trap() there are cot and rollmat, and no sign of fur\_rollmat. Double check your PR code (I haven’t found your PR, sorry, so, couldn’t check it myself) and hope it was just a bad merge.

`if(it->type->id == "cot"){
  message << _("You unfold the cot and place it on the ground.");
  type = tr_cot;
  practice = 0;
 } else if(it->type->id == "rollmat"){
  message << _("You unroll the mat and lay it on the ground.");
  type = tr_rollmat;
  practice = 0;
`

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [October 29, 2013, 7:36pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/17 "2013-10-29T19:36:14Z")

</div>

You are 100% correct!

I just check the iuse function for it and sure enough, it wasn’t there at all.

I’m gonna blame this on a bad merge.

[A fix has been PR’ed!](https://github.com/CleverRaven/Cataclysm-DDA/pull/3954)

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [October 29, 2013, 7:37pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/18 "2013-10-29T19:37:37Z")

</div>

> [@Rivet](#):
>
> I’m gonna blame this on a bad merge.

HEY! that’s… probably what happened \<\_\<

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [October 29, 2013, 7:40pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/19 "2013-10-29T19:40:17Z")

</div>

Well I know that it worked fine when I originally PR’ed it. I’m guessing that file didn’t get pushed across like it was supposed to, or else something ate it during the merge process itself.

---

<div class="post-metadata">

**Author:** ![AVE](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@AVE](https://discourse.cataclysmdda.org/u/AVE)\
**Post date:** [October 29, 2013, 10:23pm UTC](https://discourse.cataclysmdda.org/t/infinite-bear-traps-experimental-build/3597/20 "2013-10-29T22:23:55Z")

</div>

As noone fixed the roadmap and extra battery mod yet, I’ve done that myself. [PR here](https://github.com/CleverRaven/Cataclysm-DDA/pull/3957).
