-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: take child result into account in ConditionAction::modify #5042
base: develop
Are you sure you want to change the base?
Conversation
The "assess whether original logic was intentional" is the kind of thing that makes me look for a unit test. I see that this change to the code didn't change the result of any the existing I'm also not sure how to interpret Terasology/engine-tests/src/test/java/org/terasology/engine/logic/behavior/SelectorTest.java Lines 11 to 22 in be0f9de
How does that mean |
No idea either... I would hope that @casals can shed some light here.
The fact that none of the existing tests fails with this change tells me that if the original logic was intentional, we don't seem to have the associated assumptions covered in any of these tests. Would be interesting to understand what the existing tests are supposed to cover. |
This test checks if the returned states are as expected, according to a predefined enum: https://github.com/MovingBlocks/Terasology/blob/be0f9ded060c09c4aa29cec8bc811ded35dc14c1/engine/src/main/java/org/terasology/engine/logic/behavior/core/BehaviorState.java |
The
modify
method checks the condition, but doesn't make use of the input parameterBehaviorState result
which it gets passed to fromDecoratorNode
based on previous execution of the node's child.I believe that this is one of the issues leading to Terasology/WildAnimals#98.
TODO:
modify
inGuardAction
as well (or instead?)