fix: initialize dependent state if necessary#147
Merged
wlsnmrk merged 1 commit intochickensoft-games:mainfrom Feb 17, 2026
Merged
fix: initialize dependent state if necessary#147wlsnmrk merged 1 commit intochickensoft-games:mainfrom
wlsnmrk merged 1 commit intochickensoft-games:mainfrom
Conversation
Updated DependencyResolver to use IDependent's DependentState property instead of attempting to access the dependent-state data directly from the MixinState. The DependentState property initializes the blackboard value if it doesn't already exist, preventing exceptions when the dependent state hasn't yet been added to the blackboard before resolution (e.g., in tool-script scenarios).
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.
Fixes #146.
Updated
DependencyResolverto useIDependent'sDependentStateproperty instead of attempting to access the dependent-state data directly from theMixinState. TheDependentStateproperty initializes the blackboard value if it doesn't already exist, preventing exceptions when the dependent state hasn't yet been added to the blackboard before resolution (e.g., in tool-script scenarios).This change resolves #146, so the cold-reload on building the C# project doesn't output errors, even with the dependent tool scene open.
Notes on modified methods:
Resolve()is only called fromHandler().Handler()is called viaIIntrospectiveRef.InvokeMixins()inNotifyExtensions.Notify(), which shouldn't throw exceptions anyway.DependencyResolver.DependOn()is invoked fromDependentExtensions.DependOn(), and preventing the exception in that scenario is the objective of this change.