|
From: <gi...@cr...> - 2026-01-27 16:30:15
|
via 2976efafa4b088458e9a2d68b6edb28e3e609094 (commit)
from 231e7417e9e9573ad8c62913d576df266f97f607 (commit)
-----------------------------------------------------------------------
commit 2976efafa4b088458e9a2d68b6edb28e3e609094
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
|