Fix certain soldiers staring at the player for potentially hundreds of seconds after Bad Cop says something #245
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.
This PR fixes an issue in which soldiers selected to respond to Bad Cop stare at the player for a time value which wasn't subtracted from the server clock. More specifically, they stare at the player for 3 seconds more than the value the server clock will be when Bad Cop stops speaking, rather than simply staring at the player for the amount of time Bad Cop is speaking plus 3 seconds. While additional look targets can still be assigned, the player look target remains in the background and always reemerges if its duration has not passed. This also prevents the regular idle/tactical look target code from running, as it requires the soldier to not have any active look targets. This not only prevents soldiers from looking at hints or other entities in the world, but it also prevents soldiers from looking at or sometimes even noticing enemies in combat, as they are dead-set on staring at Bad Cop.
This issue appears to have been present since late 2019, and it most likely went unnoticed because the usual number of soldiers in the player's squad made it more difficult to notice that one of them was constantly staring at you, and the fact that it exponentially increases with the server clock means that this will mainly become a problem during longer playthroughs, when you're less likely to look at each individual soldier and realize one of them has been staring at you for 4 years because you had the gall to say something.