Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this.
What have you changed and why?
Static crew could be created with simulation disabled due to their creation code running NATOinit before moving them into the static weapon. Because static crew are assumed to have simulation enabled, they'd remain disabled, making them invulnerable to damage.
This PR fixes the issues by moving the NATOinit calls after moveInGunner. Structure is generally bad but I'll probably be reworking garrisons soon-ish so it'll do for now.
Please specify which Issue this PR Resolves.
closes #2666
Please verify the following and ensure all checks are completed.
Is further testing or are further changes required?
How can the changes be tested?
In theory you can trigger the original issue by moving within spawn distance of a marker and then immediately moving out again, so that at least some of the NATOinit calls for static crew are executed with the spawn state at DISABLED (1). Haven't bothered trying that though. Should be possible because there's a 1-second sleep for each 2-man patrol generated before any statics are spawned, and distance.sqf typically runs once per second.