Skip to content

A channel's hold survives a failure of its own spell, so a recast keeps FishingLoop - #3043

Merged
samwhosung merged 1 commit into
samwhosung:mainfrom
Thorsten42:fix/channel-hold-survives-recast
Nov 21, 2026
Merged

samwhosung merged 1 commit into
samwhosung:mainfrom
Thorsten42:fix/channel-hold-survives-recast

Conversation

@Thorsten42

Copy link
Copy Markdown
Contributor

Hi, my claude agent found again a bug in benilla, with a fix.

What happens

Cast Fishing, then cast it again while the bobber is still out, which is the usual way to fish. The new channel runs (cast bar, line, bobber), but after FishingCast (133) the body falls back to Stand with the pole hanging at its side instead of holding FishingLoop (134). The 1.12.1 client keeps FishingLoop, the pole held up in both hands. The first cast from standing is fine.

Why

On a recast the server sends, within one update: the old channel's stop, SMSG_SPELL_FAILED_OTHER for the same spell id, then the new cast's start, go and channel start. UNIT_CHANNEL_SPELL reads 7620 on both sides of the update, so the channel poll in route_cast_visuals sees no edge and arms nothing. The CastEventKind::Fail | CastEventKind::Reap arm removes every CastHold with a matching spell id, including the hold the channel poll armed. Nothing re-arms it, so the base picks Stand for the rest of the channel.

What 1.12.1 does

  • SMSG_SPELL_FAILED_OTHER (0x6e8e40) calls 0x60d040(spell, 1, 1) and 0x614150(spell, 0); SMSG_SPELL_FAILURE (0x6e8de4) and the auto-repeat stop (0x6ea139) call the same 0x614150(spell, 0).
  • With force 0, 0x614150 skips an effect whose flags [+0x2c] carry 0x1000 or 0x20 (0x614179, 0x614181).
  • CGUnit_C::StartChannelVisual (0x612a30) plays the channel kit as kind 2 (0x60edf0(kit, …, 2, 0)), and kind 2 sets 0x1000 (jump table 0x60f4f8, case 0x60eec7).
  • So the channel kit's effect, and the stationary pin it holds on [CGUnit+0xb4], survive the failure. Only the field watcher ends it (0x604b70 → 0x60d1c0), and an equal rewrite of the field signals nothing (benilla-re objectlayer/fields, "when a watcher runs").

The change

CastHold gets a channel flag, set only by the channel poll. The Fail | Reap arm drops a hold only when the channel did not arm it. A precast hold still drops as before, and the channel's own end (the field's change) still drops the channel's hold.

Verified

  • New test a_failure_of_the_channelled_spell_keeps_the_channels_hold: fails on main, passes with the change. The other spell_visual tests are unchanged.
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings and WOW_DATA= cargo test --workspace on this branch (one commit on main at dbc37d62e).
  • Live on a local server: three Fishing casts, the second and third over a running bobber. With WOW_MOVE_TRACE (tag anim), the recasts went 133 → Stand before the change and 133 → 134, held until the channel's end, after it.

The data was Turtle WoW's, but the visual (759, kits 829/830) and the packet order are stock 1.12.1; nothing Turtle-specific is involved.

🤖 Generated with Claude Code

…ps FishingLoop

Recasting Fishing over its running bobber: the server fails the old cast
(SMSG_SPELL_FAILED_OTHER) and starts the new one in one update, so UNIT_CHANNEL_SPELL reads
7620 on both sides and the channel poll arms nothing. The Fail/Reap arm dropped every
CastHold of that spell id, the channel's included, so the body fell back to Stand with the
pole hanging for the rest of the channel. 1.12.1's 0x614150(spell, 0) skips effects flagged
0x1000 (0x614179), which the channel kit played as kind 2 carries (0x60f4f8 case 0x60eec7);
only the field's change ends it (0x60d1c0). CastHold now records whether the channel armed
it, and the unforced stop spares that hold.

Verified: new test a_failure_of_the_channelled_spell_keeps_the_channels_hold fails before and
passes after; fmt, clippy -D warnings and WOW_DATA= cargo test (plain build). Live on the
local Turtle realm: three Fishing casts, the recasts now hold 134 (trace before: Stand).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@samwhosung
samwhosung merged commit 474c81e into samwhosung:main Nov 21, 2026
3 checks passed
@samwhosung

Copy link
Copy Markdown
Owner

Thanks, this was right as it stood: 0x614150(spell, 0) skips an effect flagged 0x1000, and the channel kit plays as kind 2, which sets it (0x60eecd), so only the channel field's change ends the hold. Merged as is.

@Thorsten42
Thorsten42 deleted the fix/channel-hold-survives-recast branch November 21, 2026 19:09
rblaine95 added a commit to bunkerlab-net/benilla that referenced this pull request Nov 21, 2026
Upstream 474c81e (samwhosung/benilla samwhosung#3043):
A recast of a channel keeps its hold, so Fishing holds FishingLoop

The fork keeps FishingLoop through a recast with no backend changes.

Regenerate the spell visual source anchor in `docs/DEVIATIONS.md`.

- `mbx fmt` and app `mbx clippy` passed on Linux. Clippy covered all
  targets with warnings denied, with and without default features.
- `creature_anim`: 282 passed, 0 failed, 0 ignored in each of four runs
  (default and no default features, installed data and empty `WOW_DATA`).
  Each empty-data run counted five data skips as passes.
- Python: verify-libtest-output 61, native-starter 182, classic-export
  347, initial-hooks 22 passed. None failed or skipped.
- `bash scripts/genmap.sh` passed.

Ave Deus Mechanicus
rblaine95 added a commit to bunkerlab-net/benilla that referenced this pull request Nov 21, 2026
4b2f003 merged upstream 474c81e (samwhosung#3043, a recast of a channel
keeps its hold, so Fishing holds FishingLoop) onto 2f0a815 and ran
the checks for the touched client files. The feature head had moved on
by six local commits (PlayerOutfit and WorldTail3), so this joins that
merge here instead of rewriting either history.

The automatic merge resolved cleanly. The client files equal the
verified merge byte for byte. No server runtime, simulation or script
file changes. Genmap regenerated the deviation source link.

Ave Deus Mechanicus
ornfelt added a commit to ornfelt/benilla that referenced this pull request Nov 23, 2026
…ung#3042, samwhosung#3043, samwhosung#3045, samwhosung#3046 and the fork's no-change merge) merged as is - no conflicts, no gfx trigger (protocol self flag and ActivePlayerCreate, script-call host validation and boxed disjoint state, live-read routing, unit field watchers, channel cast holds), the feature-off diff against main the same lines before and after; cargo check --workspace --all-targets clean with and without benilla/gfx, benilla-protocol and benilla-ui tests green apart from lua50 table_size's a_nested_sort_costs_one_host_level_per_comparator, which reaches 58 of 150 levels at dev-fast's opt-level 0 and passes at dev, benilla-app net, creature_anim, script_calls, ui_unit, ui_chat, lanes and ui_script tests green at dev-fast, built on Windows only
ornfelt added a commit to ornfelt/benilla that referenced this pull request Nov 23, 2026
…ung#3042, samwhosung#3043, samwhosung#3045, samwhosung#3046 and the fork's no-change merge) merged as is - no conflicts, no gfx trigger (protocol self flag and ActivePlayerCreate, script-call host validation and boxed disjoint state, live-read routing, unit field watchers, channel cast holds), the branch's diff against main the same lines before and after, no schedule change (frame test green); cargo check --workspace --all-targets clean, benilla-protocol and benilla-ui tests green apart from lua50 table_size's a_nested_sort_costs_one_host_level_per_comparator, which reaches 58 of 150 levels at dev-fast's opt-level 0 and passes at dev (the eight_nested_switches_fit_a_two_megabyte_stack case again), benilla-app net, creature_anim, script_calls, ui_unit, ui_chat, lanes, ui_script and frame tests green at dev-fast, built on Windows only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants