AI : Issue with default GetBestThreatTarget function
- Dominant language
- Lua
- Stars
- 264
- Forks
- 260
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 21
Description
**Describe the bug**
This function is supposed to be able to target specific enemy indexes if the var TargetCurrentEnemy is set. If not it leaves the index is -1. It was originally thought that this means it would get all threats but testing has shown this is not the case so this function is not evaluating all threats and means that in multi player games any platoon using this may not get the correct targets due to not evaluating all available threat.
**To Reproduce**
Setup multi player game and have AI draw results of the threat table. You will see that threat is only being returned for a single enemy rather than the whole team even though no enemy index is specified.
**Expected behavior**
All map threats will be returned for evaluation.
**Screenshots**

**Additional context**
Solution is to set the index to nil so that it is not passed to the threat functions when no index is specified. Though this still needs to be validated.
Contributor guide
Assessment
This issue has not been assessed yet.