-
Notifications
You must be signed in to change notification settings - Fork 246
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
Guarded task start() method running before guard. #89
Comments
Yeah I see your point. child.setControl(this);
child.start();
if (child.checkGuard(this))
child.run();
else
child.fail(); with something along the line of child.setControl(this);
boolean ok = child.checkGuard(this);
child.start();
if (ok)
child.run();
else
child.fail(); I'm really busy these days, sorry. Can you try it and let me know? |
I can't see how this change would fix the problem. |
Well, maybe I'm missing something. As said above, I've not tested this change myself. Just looked quickly into the code.
wouldn't this change make guard run before |
I'm just wondering if start method shouldn't be called at all in this context. Wiki says :
But "task execution" is not clearly defined. Is start method included in "task execution" ? DynamicGuardSelector evaluates guard before starting children but Selector (and others) doesn't. Consider following example :
Should we really start eating even if we're not hungry ? |
Sounds reasonable. It looks like this code child.setControl(this);
child.start();
if (child.checkGuard(this))
child.run();
else
child.fail(); should become child.setControl(this);
if (child.checkGuard(this)) {
child.start();
child.run();
}
else
childFail(null); // actually child has not failed This kind of code should work for |
@davebaol any plan to fix this? IMHO |
Is it intended to run start() method of guarded task before guard?
In my case I'm using guards to check if task should run and I'm setting some values that guarded task may use.
For example:
(isPlayerVisible? range:512 outVar:"targetPlayer") interpose ent1Var:"targetGuardEnt" ent2Var:"targetPlayer"
Guard is checking if any player is visible and output visible player reference to blackboard. Interpose task is using this reference in its start() method to set up Interpose task. But because interpose start() method is run before guard I've got null ptr exception.
The text was updated successfully, but these errors were encountered: