From 7b6b1eadcd80fc8e3c5036d62747578911186957 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 26 Apr 2018 10:04:00 -0500 Subject: [PATCH] Update coding-guidelines.md (#6303) * Update coding-guidelines.md * Update coding-guidelines.md --- docs/wiki/development/coding-guidelines.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/wiki/development/coding-guidelines.md b/docs/wiki/development/coding-guidelines.md index 3e83c631cf..23ad2317f9 100644 --- a/docs/wiki/development/coding-guidelines.md +++ b/docs/wiki/development/coding-guidelines.md @@ -780,17 +780,14 @@ while {true} do { ``` ### 8.9 `waitUntil` -The `waitUntil` command shall not be used. Instead, make use of a per-frame handler: - +The `waitUntil` command shall not be used. Instead, make use of CBA's `CBA_fnc_waitUntilAndExecute` ```js [{ - params ["_args", "_id"]; - _args params ["_unit"]; - - if (_unit getvariable [QGVAR(myVariable), false]) exitwith { - [_id] call CBA_fnc_removePerFrameHandler; - - // Execute any code - }; -}, [_unit], 0] call CBA_fnc_addPerFrameHandler; + params ["_unit"]; + _unit getVariable [QGVAR(myVariable), false] +}, +{ + params ["_unit"]; + // Execute any code +}, [_unit]] call CBA_fnc_waitUntilAndExecute; ```