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

Fix static crew simulation bug #2677

Merged

Conversation

jaj22
Copy link

@jaj22 jaj22 commented Mar 22, 2023

What type of PR is this.

  1. Bug
  2. Change
  3. Enhancement

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.

  1. Have you loaded the mission in LAN host?
  2. Have you loaded the mission on a dedicated server?

Is further testing or are further changes required?

  1. No
  2. Yes (Please provide further detail below.)

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.

@jaj22 jaj22 added the Bug-fix label Mar 22, 2023
@jaj22 jaj22 added this to the 3.2 milestone Mar 22, 2023
Copy link

@killerswin2 killerswin2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

Copy link

@Bob-Murphy Bob-Murphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Bob-Murphy Bob-Murphy merged commit b8d96b0 into official-antistasi-community:unstable Mar 22, 2023
@Bob-Murphy Bob-Murphy added the Added to changelog Added to changelog label May 8, 2023
igorkis-scrts pushed a commit to igorkis-scrts/A3-Antistasi-Plus that referenced this pull request Aug 8, 2023
…tatic-crew-init

Fix static crew simulation bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Static gunners can spawn with simulation disabled
4 participants