# Fix for Issue #36 (monsters warp through walls to follow you down stairs)?

**URL:** <https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502>\
**Category:** The Lab\
**Created:** [March 17, 2013, 12:51am UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502 "2013-03-17T00:51:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uronym](https://avatars.discourse-cdn.com/v4/letter/u/848f3c/32.png) [@Uronym](https://discourse.cataclysmdda.org/u/Uronym)\
**Post date:** [March 17, 2013, 12:51am UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/1 "2013-03-17T00:51:54Z")

</div>

I have no idea if this works or not, because I’m not sure how to test it, but, if you add this code at line ~770 in function monster::will\_reach of monmove.cpp, does it fix [Issue #36](https://github.com/TheDarklingWolf/Cataclysm-DDA/issues/36), where monsters will warp with you down stairs, even if there’s no valid path to the stairs?

```auto
std::vector<point> path = g->m.route(posx, posy, x, y, has_flag(MF_BASHES));
 if (path.size() == 0)
  return false;
```

I couldn’t find any documentation for the route function, but from what I could tell, if size == 0, it means there is no valid path. If I understand this right, it will make monster::will\_reach return false if there’s no valid path.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)\
**Post date:** [March 17, 2013, 4:53am UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/2 "2013-03-17T04:53:49Z")

</div>

Someone needs to test this, and merge.

---

<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:** [March 17, 2013, 4:22pm UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/3 "2013-03-17T16:22:51Z")

</div>

Awesome, merged to master branch.

---

<div class="post-metadata">

**Author:** ![n9103](https://avatars.discourse-cdn.com/v4/letter/n/e19adc/32.png) [@n9103](https://discourse.cataclysmdda.org/u/n9103)\
**Post date:** [March 18, 2013, 1:08am UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/4 "2013-03-18T01:08:31Z")

</div>

Epic first post Uronym, fixing a long standing game-breaking bug with a single check.

---

<div class="post-metadata">

**Author:** ![Mr\_Lolz](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Mr\_Lolz](https://discourse.cataclysmdda.org/u/Mr_Lolz)\
**Post date:** [March 18, 2013, 8:14pm UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/5 "2013-03-18T20:14:35Z")

</div>

this community clearly attracts silent heroes

---

<div class="post-metadata">

**Author:** ![Drakasin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/drakasin/32/850_2.png) [@Drakasin](https://discourse.cataclysmdda.org/u/Drakasin)\
**Post date:** [March 18, 2013, 8:52pm UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/6 "2013-03-18T20:52:26Z")

</div>

Someone give this guy a medal.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/1X/21b5d044e8473b25d0bf905d60477e25f6fbe0cf.png) [@system](https://discourse.cataclysmdda.org/u/system)\
**Post date:** [March 28, 2013, 4:24am UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/7 "2013-03-28T04:24:48Z")

</div>

Here, have a Mininuke (Active)!

---

<div class="post-metadata">

**Author:** ![Jihelu](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@Jihelu](https://discourse.cataclysmdda.org/u/Jihelu)\
**Post date:** [March 28, 2013, 9:25pm UTC](https://discourse.cataclysmdda.org/t/fix-for-issue-36-monsters-warp-through-walls-to-follow-you-down-stairs/502/8 "2013-03-28T21:25:42Z")

</div>

Add this man to the credits. Labled" God"
