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

Replace all use of count as a forEach #1242

Merged
merged 3 commits into from
Oct 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions addons/statemachine/fnc_clockwork.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ SCRIPT(clockwork);
private _stateMachine = _x;
private _list = _stateMachine getVariable QGVAR(list);
private _skipNull = _stateMachine getVariable QGVAR(skipNull);
private _updateCode = _stateMachine getVariable QGVAR(updateCode);
private _id = _stateMachine getVariable QGVAR(ID);
private _tick = _stateMachine getVariable QGVAR(tick);

Expand All @@ -36,6 +35,7 @@ SCRIPT(clockwork);

// When the list was iterated through, jump back to start and update it
if (_tick >= count _list) then {
private _updateCode = _stateMachine getVariable QGVAR(updateCode);
commy2 marked this conversation as resolved.
Show resolved Hide resolved
_tick = 0;
if !(_updateCode isEqualTo {}) then {
_list = [] call _updateCode;
Expand Down Expand Up @@ -102,5 +102,4 @@ SCRIPT(clockwork);
(GVAR(performanceCounters) select _id) pushBack _perfRunTime;
#endif

false
} count GVAR(stateMachines);
} forEach GVAR(stateMachines);