zen-mod / ZEN

Zeus enhancement mod for Arma 3
https://zen-mod.github.io/ZEN
GNU General Public License v3.0
108 stars 47 forks source link

Deep copy/paste will include ACRE radio ID's #636

Closed mjc4wilton closed 2 years ago

mjc4wilton commented 2 years ago

Arma 3 Version: 2.04 CBA Version: 3.15.5 (stable / dev + commit hash) ZEN Version: 1.11.1 (stable / dev + commit hash)

Mods:

- CBA_A3
- ZEN
- ACE
- ACRE

Description: When using deep copy/paste on units with ACRE radios, their radio ID's are copied as well, creating two sets of the same radio and has the potential to completely break both the original and deep-copied radios.

Expected behavior: Each unit should have their own radios with their own radio ID's.

Steps to reproduce:

  1. Equip a loadout on yourself with ACRE radios
  2. Deep copy yourself
  3. Deep paste yourself
  4. Notice that executing systemChat str (["ACRE_PRC152", _this] call acre_api_fnc_getAllRadiosByType) in the ZEN init box for both units will return the same radios.

Where did the issue occur?

Additional information: ACRE provides the function acre_api_fnc_filterUnitLoadout which will filter a unit loadout array to ensure this issue doesn't happen. Most likely a CfgPatches check for ACRE + using this function in zen_common_fnc_serializeObjects would fix the issue and I might slap the PR together myself if I get time.