# Crash: using chain lightning on reinforced glass

**URL:** <https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849>\
**Category:** The Garage\
**Created:** [November 10, 2014, 11:38pm UTC](https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849 "2014-11-10T23:38:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpyder](https://avatars.discourse-cdn.com/v4/letter/x/e8c25b/32.png) [@xpyder](https://discourse.cataclysmdda.org/u/xpyder)\
**Post date:** [November 10, 2014, 11:38pm UTC](https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849/1 "2014-11-10T23:38:23Z")

</div>

I was in a fema camp and fired a chain lightning at some soldiers behind reinforced glass, the lightning “hits” the square right before the glass as expected, but the game immediately becomes non responsive and a few minutes later crashes completely. I tested a second time and the same thing happened.

Given the long “freeze” I suspect it’s going into some sort of loop it can’t recover from.

---

<div class="post-metadata">

**Author:** ![xpyder](https://avatars.discourse-cdn.com/v4/letter/x/e8c25b/32.png) [@xpyder](https://discourse.cataclysmdda.org/u/xpyder)\
**Post date:** [November 10, 2014, 11:39pm UTC](https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849/2 "2014-11-10T23:39:12Z")

</div>

Version: 9edc0ef

---

<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:** [November 11, 2014, 12:32am UTC](https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849/3 "2014-11-11T00:32:56Z")

</div>

Apparently chain lightning invokes projectile\_attack infinitely when a target is visible but unreachable.  
Upon hitting anything, it will fork to nearest visible (from last hit location) creature (never NPC or player) that doesn’t have “bounced” state. Only actually hit (not just targetted) creatures get the “bounced” state.

It could be fixed by simply applying “bounced” before attempting to fork. More “proper” solutions (actually ignoring unreachable targets) would be more complex than they sound at first, because chain lightning actually has its own dispersion, meaning it could repeatedly miss (and strike an obstacle on the way).

I’ll try to write a simple fix.

---

<div class="post-metadata">

**Author:** ![xpyder](https://avatars.discourse-cdn.com/v4/letter/x/e8c25b/32.png) [@xpyder](https://discourse.cataclysmdda.org/u/xpyder)\
**Post date:** [November 11, 2014, 6:21pm UTC](https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849/4 "2014-11-11T18:21:47Z")

</div>

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)\
**Post date:** [November 12, 2014, 4:47am UTC](https://discourse.cataclysmdda.org/t/crash-using-chain-lightning-on-reinforced-glass/7849/5 "2014-11-12T04:47:14Z")

</div>

Merged. Nice job by Coolthulhu.
