Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions module/src/creatures/cycle/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,18 +857,16 @@ impl RoutSink for CtxWorld<'_> {
}

impl FearSink for CtxWorld<'_> {
// KNOWN DEBT, inherited verbatim with the pass: `game_aura` carries no by-mechanic index, so the
// fear rows are found by scanning the aura table, which is itself small — fear uptime is rare.
// ponytail: one row per AURA, not per feared creature, so a doubly-feared creature is resolved
// twice and the phase collapses it. Ceiling: a second `fear_source` scan for a rare case.
// One row per aura, not per feared creature, so a doubly-feared creature is resolved twice and
// the phase collapses it. A second `fear_source` probe preserves the first-caster tie break.
fn panicked(&self, scope: &TickScope) -> Vec<Panicked> {
let entities = self.ctx.db.game_world_entity();
let melee = self.ctx.db.game_melee_attack();
self.ctx
.db
.game_aura()
.iter()
.filter(|a| a.eff_kind == crate::spell::A_CONTROL && a.eff_p0 == crate::spell::M_FEAR)
.by_kind_param()
.filter((crate::spell::A_CONTROL, crate::spell::M_FEAR))
.filter_map(|a| {
let c = tick::movable_creature(self.ctx, a.target_guid, scope)?;
// Re-resolved rather than read off the row above, so which caster wins when a
Expand Down
4 changes: 2 additions & 2 deletions module/src/creatures/cycle/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6081,8 +6081,8 @@ fn the_production_adapter_is_the_pass_through_the_harness_assumes() {
concat!(
"{ fn panicked(&self, scope: &TickScope) -> Vec<Panicked> { let entities = ",
"self.ctx.db.game_world_entity(); let melee = self.ctx.db.game_melee_attack(); ",
"self.ctx .db .game_aura() .iter() .filter(|a| a.eff_kind == ",
"crate::spell::A_CONTROL && a.eff_p0 == crate::spell::M_FEAR) .filter_map(|a| { ",
"self.ctx .db .game_aura() .by_kind_param() .filter((crate::spell::A_CONTROL, ",
"crate::spell::M_FEAR)) .filter_map(|a| { ",
"let c = tick::movable_creature(self.ctx, a.target_guid, scope)?; let source = ",
"crate::spell::fear_source(self.ctx, c.guid)?; let at = ",
"entities.guid().find(source).or_else(|| { melee .attacker_guid() .find(c.guid) ",
Expand Down
3 changes: 3 additions & 0 deletions module/src/spell/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ pub struct SpellProcEvent {
public,
index(accessor = by_target, btree(columns = [target_guid])),
index(accessor = by_expiry, btree(columns = [expires_at])),
// Creature fear movement runs every firing. This exact pair finds its sparse candidates without
// reading unrelated buffs, passive effects, periodic effects, or Procs.
index(accessor = by_kind_param, btree(columns = [eff_kind, eff_p0])),
// Perf catalog 1.9: the same recipe as `by_expiry`, for the PERIODIC pass. `next_tick_micros == 0`
// is the non-periodic sentinel, so a `1..=now` range skips every buff/passive for free.
index(accessor = by_next_tick, btree(columns = [next_tick_micros]))
Expand Down
Loading