official-antistasi-community / A3-Antistasi

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

[Arma bug]: Using hideObjectGlobal twice on objects may reveal them #3332

Open jaj22 opened 1 week ago

jaj22 commented 1 week ago

Using hideObjectGlobal twice on objects appears to reveal them under some conditions. There's a mostly repeatable example on Virolahti: The outp_18_vehicle marker is placed together with a hide object module to remove some trees. However, tree-removal code is also applied to vehicle markers. This appears to cause the trees to be revealed, even though the code only hides.

This is only replicable if Virolahti was not the previous map loaded (you can re-replicate by loading another map and then back to Virolahti), and I can't replicate the effect outside Antistasi, probably because it requires the hiding to happen at specific timings.

Adding an isObjectHidden check before hiding the trees also seems to workaround the problem, but we should check other uses of hideObjectGlobal to make sure that it's never used on objects that may already be hidden. hideObject may or may not be subject to the same bug.

jaj22 commented 3 days ago

Ok, this is not the issue. Improved the code and now it's failing more reliably. Guessing it's an Arma bug where hiding objects doesn't work on some mission startup timings, maybe related to HQ proximity (outpost 18 is a little over 1km from the default spawn). Might not be an easy workaround.