Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle composite GameRuleTypes conflicting with composed types #185

Open
Gegy opened this issue Nov 17, 2021 · 0 comments
Open

Handle composite GameRuleTypes conflicting with composed types #185

Gegy opened this issue Nov 17, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Gegy
Copy link
Member

Gegy commented Nov 17, 2021

Currently, GameRuleType.allOf generates a rule that enforces all of the given rule types. This works fine until you want to set up a case where you override the general rule type with a more specific one.

For example, with the INTERACTION and USE_BLOCKS rules. INTERACTION implies USE_BLOCKS, but setting USE_BLOCKS should override INTERACTION. Currently, this does not work: all rules that are set to allow return ActionResultType.PASS from their events. This is such that returning ActionResultType.SUCCESS does not end up cancelling vanilla logic, because we want that to run. The problem here, however, is that returning PASS continues processing for other events. This means a set-up with USE_BLOCKS allowed will return PASS, causing the INTERACTION rule to still apply and not be overridden.

The solution for this would ideally involve having a result type that can represent "pass to vanilla logic, but don't continue processing events", but this may be a significant breaking change to Stimuli. Potentially the best we can do is manage colliding rule results internally in the rule handler to avoid issues such as this.

@Gegy Gegy added the bug Something isn't working label Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant