Skip to content

Switch an effect's light off together with the effect - #1085

Open
pieterdeschepper wants to merge 1 commit into
Try:masterfrom
pieterdeschepper:effect-light-follows-active
Open

pieterdeschepper wants to merge 1 commit into
Try:masterfrom
pieterdeschepper:effect-light-follows-active

Conversation

@pieterdeschepper

@pieterdeschepper pieterdeschepper commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

In Gothic 1, when a skeleton mage is killed while summoning skeletons, a red light stays in the world where he died.

The summon spell's visual effect (spellFX_Skeleton, lightPresetName="REDAMBIENCE") raises the light range to 400 on KEY_INVEST_1. Normally the light disappears after the cast, because KEY_INIT sets the range to 0.01. When the caster dies mid-invest:

  • Npc::onNoHealth → updateWeaponSkeleton → pfx.view.setActive(false) deactivates the hand effect.
  • Effect::setActive only switched the particles and the sound. The light kept its invest range, so it stayed.

Change

  • Effect::setActive also enables or disables the effect's light.
  • LightGroup::Light::setEnabled(true) restores the light's range. It used to leave ssbo.range at 0, which only went unnoticed because nothing re-enabled a light so far. The hand effect now does, when a spell is drawn again.

Side effect: a light on any effect that gets deactivated (for example a hand effect when the spell is put away) now switches off with it, instead of keeping its last range.

Testing

Built and run on macOS (Apple M3 Pro) in a local build.

🤖 Generated with Claude Code

Effect::setActive enabled and disabled particles and sound, but not the
light. When a spellcaster dies while investing (e.g. a Gothic 1
skeleton mage summoning skeletons), the hand effect is deactivated with
its invest key still set, and its light (REDAMBIENCE, range 400) stays
in the world. Normally the light only fades because the Init key sets
its range to almost zero after the cast.

LightGroup::Light::setEnabled(true) also kept the range at 0; it now
restores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant