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

fnc_waitUntilAndExecute now can timeout for 0s #911

Merged
merged 3 commits into from
Apr 29, 2018
Merged

fnc_waitUntilAndExecute now can timeout for 0s #911

merged 3 commits into from
Apr 29, 2018

Conversation

felixlinker
Copy link
Contributor

References #910

CBA_fnc_waitUntilAndExecute now adopts timeout behaviour for timeout values > 0.

@commy2
Copy link
Contributor

commy2 commented Apr 21, 2018

That's what I imagined, but it still wouldn't execute code immediately, but later the frame or next frame.
This makes sense to me and is the behaviour I would expect.
The PR basically inverts the behavior for 0 and -1 tiímeout. Idk what the implications of that are for third party mods using this function, though I doubt 0 or -q is used much.
I would also describe 0 and -1 to the functions header.

@@ -3,7 +3,8 @@ Function: CBA_fnc_waitUntilAndExecute

Description:
Executes a code once in unscheduled environment after a condition is true.
It's also possible to add a timeout, in which case a different code is executed.
It's also possible to add a timeout >= 0, in which case a different code is executed.
Then it will be waited until _timeout time has elapsed or _condition evaluates to true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commy2 suggests, describe what timeout 0 and -1 will mean.

@Killswitch00 Killswitch00 merged commit eebfc48 into CBATeam:master Apr 29, 2018
@felixlinker felixlinker deleted the patch-1 branch April 29, 2018 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants