Sometimes LAC allows the player to select, as his target, the aircraft designated as HIS. I have definitely seen this when I have flown as Player #1 and am permitted to select aircraft #1 as my current target. The target selection logic should always prevent any player from designating the aircraft with his own "MyNetworkId" value as his current target. Whenever his request to select "Next Target" or "Previous Target" would naturally lead him to select himself, the logic should skip over his own MyNetworkId value and select the next one (up or down) in the sequence. Hereafter let's refer to this bug as "Target Select allows Self-Select bug".
Last edit: bbosen 2026-10-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As you can see, that little block of code is only active if "SelectedMissionTarget" is an odd number, which is always true for RedTeam mission objects. But consider what happens if the value of "SelectedMissionObject is "29" (this will always be the case when the player continues to press "TargetNextRed" until there are no more RedTeam objects, since the last RedTeam object is always #29). The logic adds 2, so "SelectedMissionTarget" becomes 31. Then the value is tested for overflow, and if it is higher than "29", it is reset to "1", resulting in selection of object "1" which is the very definition of this bug!
As you can see, the suggested new code includes additional logic to detect cases when overflow beyond the last mission object that can be selected attempts to select object
"1" but the player's "MyNetworkId" is already equal to "1" (which would try to select
his own aircraft as his target). In that case, the suggested new logic skips over object "1"
and thereafter tries to select the next RedTeam object. Since RedTeam objects always have
odd numbers, the next available value is "3" which is calculated by adding "2" to the "1"
in "SelectedMissionTarget".
Last edit: bbosen 2026-10-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sometimes LAC allows the player to select, as his target, the aircraft designated as HIS. I have definitely seen this when I have flown as Player #1 and am permitted to select aircraft #1 as my current target. The target selection logic should always prevent any player from designating the aircraft with his own "MyNetworkId" value as his current target. Whenever his request to select "Next Target" or "Previous Target" would naturally lead him to select himself, the logic should skip over his own MyNetworkId value and select the next one (up or down) in the sequence. Hereafter let's refer to this bug as "Target Select allows Self-Select bug".
Last edit: bbosen 2026-10-14
I think I found the source of this bug. In main.cpp's "event_targetNextRed()" function, take a look at this little block of code:
As you can see, that little block of code is only active if "SelectedMissionTarget" is an odd number, which is always true for RedTeam mission objects. But consider what happens if the value of "SelectedMissionObject is "29" (this will always be the case when the player continues to press "TargetNextRed" until there are no more RedTeam objects, since the last RedTeam object is always #29). The logic adds 2, so "SelectedMissionTarget" becomes 31. Then the value is tested for overflow, and if it is higher than "29", it is reset to "1", resulting in selection of object "1" which is the very definition of this bug!
That block of code should be changed to THIS:
As you can see, the suggested new code includes additional logic to detect cases when overflow beyond the last mission object that can be selected attempts to select object
"1" but the player's "MyNetworkId" is already equal to "1" (which would try to select
his own aircraft as his target). In that case, the suggested new logic skips over object "1"
and thereafter tries to select the next RedTeam object. Since RedTeam objects always have
odd numbers, the next available value is "3" which is calculated by adding "2" to the "1"
in "SelectedMissionTarget".
Last edit: bbosen 2026-10-14