fix(triggers): registration follows every flag and list change; migrator honours Running=false; no nullable value types - #2
Merged
Conversation
…deactivate unconditionally on stop and delete Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
…unregisters it Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
Both migrator construction paths were constructed running and only ever called Start(); a "Running=false" node had nothing to stop it, so the spawner stayed running (and its triggers stayed registered) regardless of what the file said. Both paths now call Stop() when the file's Running flag is false, matching the ParseSpawnPointNode form's default of true when the attribute is absent, then re-derive trigger registration through EnsureTriggersActive(). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
…script context Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
…UO #2636 recorded Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
…e registered type names; page clamp Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
…d to the engine project Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
…tive doc matches the registry semantics Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXJwRhwvHQXV2ABJHicwsr
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.
Summary
Closes the trigger-registration follow-ups parked in #1, and removes the last nullable value types from the engine.
TriggerActivatedis now a property whose setter callsEnsureTriggersActive()(serialized slot unchanged, layout byte-identical).TriggerConfigGumpadds and removes through the generated helpers (RemoveFromTriggerDefinitionsAtfor the clicked row) and re-registers after each edit;SpawnerJsonImporterclears throughClearTriggerDefinitions()so dirty tracking holds.TriggerSystem.ActivateTriggersstill has exactly one caller.OnStoppedandOnDeletecallDeactivateTriggersunconditionally (a no-op when nothing is registered), so clearingTriggerActivatedafter registration can no longer leave a deleted spawner in the trigger system.Running="false"on both node forms: the spawner is stopped (it is constructed running) and its triggers registered or not accordingly. Behaviour note: aRunning="true"node with zero parsed entries now imports stopped (before, it was left in its constructed running state), which matches D9's "unreproducible encounters import stopped".[ModernSpawnerPerfSeednow activates the proximity trigger it adds, so the proximity-dispatch benchmark measures something.TriggerConfigGumpwrites the time-window definitions with the trigger type namesTriggerSystemactually registers (it wrotewalltime:/gametime:before, which parsed as unknown while the gump reported success), and clamps the page after deleting the last trigger on a page.XmlSpawnerImporterdelays use theTimeSpan.ZerosentinelAddModernEntryalready understands;SkillTriggergets aTimeSpan cooldownoverload;ScriptContext.LocationOverridebecomesHasLocationOverride+Point3D. The remainingType?members live only in the legacy YAML/JSON export models (ScriptExportModels,SpawnerExportModels), which the SpawnerDto-only format decision (D5/D6) retires; they are left for that work.CLAUDE.mdrule for trigger mutations;dev-docs/architecture.md§2.2;dev-docs/modernuo-prerequisites.mdrecords ModernUO #2636 (SkillEvents.SkillChecked+ test-clock IVT) as open;dev-docs/product-spec.mdcorrects the D3 row:skill:definitions parse and register today but never fire, because nothing callsModernSpawnerEvents.OnSkillUseduntil the wiring PR subscribes to #2636's event.Test plan
TriggerActivatedregisters/unregisters; adding a definition to an activated running spawner registers immediately; deleting an activated spawner leaves nothing registered; stopping with a stale registration unregisters; deleting a stopped spawner with a stale registration unregisters; migratorRunning="false"on both node forms. Each mutation-checked against its reverted behaviour.dotnet build ModernSpawner.slnxclean; full suite green (438). The test fixture now runsEventScheduler.Configure()like production, since window triggers schedule through it.Follow-ups
TriggerSystem.OnMobileProximityallocates aTriggerContextclass per movement event per spawner; the D2 trigger-state-machine work should make it areadonly structpassed byin.