|
From: <gi...@cr...> - 2026-01-27 16:30:10
|
via ba93e64a92a34d9901f6327faaa56c32c9b96246 (commit)
from 2e857c154fd84d110ba0bf67d43edff063f8075d (commit)
-----------------------------------------------------------------------
commit ba93e64a92a34d9901f6327faaa56c32c9b96246
Author: Isaac Clancy <ik...@ya...>
Date: Wed Jan 28 05:17:35 2026 +1300
Fix petrify and rimeblight sometimes not chaining (knorpule3000)
If petrify or timeblight had passed through an unaffected monster such
as your Hep ancestor or reflected off of the warlock's mirror they would
fail to chain to nearby monsters.
Fixes #5043
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/beam.cc | 6 +++++-
crawl-ref/source/beam.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 49ff3211f3..abf23de299 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -606,6 +606,7 @@ void bolt::initialise_fire()
extra_range_used = 0;
in_explosion_phase = false;
use_target_as_pos = false;
+ enchant_chaining_done = false;
hit_count.clear();
if (special_explosion != nullptr)
@@ -5067,11 +5068,14 @@ void bolt::handle_enchant_chaining(coord_def centre)
{
// Handle ray bounces
if (!(origin_spell == SPELL_PETRIFY || origin_spell == SPELL_RIMEBLIGHT)
- || hit_count.size() != 1)
+ || enchant_chaining_done)
{
return;
}
+ // Prevent the following calls to affect_actor from recursing into here
+ enchant_chaining_done = true;
+
vector<coord_def> chain_targs;
fill_chain_targets(*this, centre, chain_targs, true);
if (chain_targs.empty())
diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h
index 0c596fa836..6b6e1d6aa9 100644
--- a/crawl-ref/source/beam.h
+++ b/crawl-ref/source/beam.h
@@ -231,6 +231,7 @@ struct bolt
bool noise_generated = false; // a noise has already been generated at this pos
bool passed_target = false; // Beam progressed beyond target.
bool in_explosion_phase = false; // explosion phase (as opposed to beam phase)
+ bool enchant_chaining_done = false; // wheather we have already chained to nearby actors
mon_attitude_type attitude = ATT_HOSTILE; // attitude of whoever fired the bolt
int foe_ratio = 0; // 100* foe ratio (see mons_should_fire())
map<mid_t, int> hit_count; // how many times targets were affected
--
Dungeon Crawl Stone Soup
|