Update coding-guidelines.md (#6303)

* Update coding-guidelines.md

* Update coding-guidelines.md
This commit is contained in:
PabstMirror 2018-04-26 10:04:00 -05:00 committed by GitHub
parent 87c3a7a334
commit 7b6b1eadcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
```