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

Change global vars to local where appropriate #4774

Merged
merged 2 commits into from
Mar 25, 2023

Conversation

relent0r
Copy link
Contributor

@relent0r relent0r commented Mar 4, 2023

closes #4717
Description of changes
This PR changes some of the vars that were accidentally set as global to locals. The main reason is to avoid concurrent AI from getting incorrect values for various vars when they are running functions.

Test setup for the changes
Confirm that all vars that have been changed to local are valid.
Observe AI games, Sorian is the most impacted AI from the changes. But it impacts the normal AI as well. There are some edge cases where two AI would call functions and have the local vars overwritten by a global in the same file.

lua/AI/aiutilities.lua Outdated Show resolved Hide resolved
lua/AI/sorianutilities.lua Outdated Show resolved Hide resolved
@Garanas Garanas merged commit be81129 into FAForever:deploy/fafdevelop Mar 25, 2023
@Garanas Garanas added this to the Development iteration II milestone Mar 25, 2023
@Garanas Garanas added the area: code style code refactoring label Mar 25, 2023
@relent0r relent0r deleted the ai/fix-locals branch September 30, 2023 18:59
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.

AI files that use globals instead of locals
3 participants