Repository navigation
Switch an effect's light off together with the effect - #1085
Open
pieterdeschepper wants to merge 1 commit into
Open
pieterdeschepper wants to merge 1 commit into
pieterdeschepper wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onKEY_INVEST_1. Normally the light disappears after the cast, becauseKEY_INITsets the range to 0.01. When the caster dies mid-invest:Npc::onNoHealth→updateWeaponSkeleton→pfx.view.setActive(false)deactivates the hand effect.Effect::setActiveonly switched the particles and the sound. The light kept its invest range, so it stayed.Change
Effect::setActivealso enables or disables the effect's light.LightGroup::Light::setEnabled(true)restores the light's range. It used to leavessbo.rangeat 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