official-antistasi-community / A3-Antistasi

Antistasi Community Version - work in progress - Discord https://discord.com/invite/TYDwCRKnKX
https://antistasi.de
Other
226 stars 156 forks source link

[Bug]: ACE handcuffs sometimes fight with undercover logic #1540

Open jaj22 opened 3 years ago

jaj22 commented 3 years ago

Describe the bug ACE handcuffs and Antistasi's undercover code both use setCaptive. Under some conditions, Antistasi will set the captive state to false to remove undercover status, leaving handcuffs in an inconsistent state. This may cause players to be incapable of entering their own vehicle (with a captive inside), or AIs firing at handcuffed players.

There are probably glitches in the other direction too, where Antistasi reports undercover state on for units that were never undercover.

To Reproduce The most common method is to capture someone while they're unconscious. When they wake up, captive state will be removed, even if they still have handcuffs on. Another method is to have someone handcuffed in a vehicle, go undercover in the vehicle and then lose undercover.

Preferred fix In the long run, the undercover system needs to be reworked to consider handcuffed state. Some elements should be worked around in the short term, notably the lose-captive-on-wakeup case.

MeltedPixel commented 1 year ago

I believe this to be fixed and closed looking at the above merge.

jaj22 commented 1 year ago

No, there's a whole range of issues. I just worked around the most obvious one.