Conversation
…to feature/populate
…to feature/populate
| private _pos = [0,0,0]; | ||
| private _dir = -1; | ||
|
|
||
| if (_numberOfPositionsToOccupy <= 1) exitWith { |
There was a problem hiding this comment.
If the count of _statics is less than _numberOfPositionsToOccupy this will never exit as the only subtraction for _numberOfPositionsToOccupy is when _statics is not empty, requiring it to be equal or greater in length
There was a problem hiding this comment.
No other exit condition for the pfh with quite a few bits going on is very risky and will likley lead to a runaway endless spawning
| Return value: | ||
| Nothing | ||
| */ | ||
|
|
There was a problem hiding this comment.
I would rework this to separate the spawning of units into statics, positions, and patrols
|
|
||
| private _group = grpNull; | ||
| private _currenGrouptUnitCount = 0; | ||
| private _patrolSize = _module getVariable [QGVAR(patrolSize), 0]; |
There was a problem hiding this comment.
0 is a bad default, should exit if value from the module is 0 otherwise the patrols will never be tasked
| Return value: | ||
| Nothing | ||
| */ | ||
|
|
There was a problem hiding this comment.
Could simplify this quite a bit by making use of common,spawnGroupInfantry.
Take the nubmer of units remaining and divide by the patrol size. Do that many iterations plus one more for the remainder.
The spawning can be staggered by using a waitAndExecute with the time based on the index of an array multiplied by seconds
When merged this pull request will: