Ace3: ace_rearm_fnc_addVehicleMagazinesToSupply returns error and nearly killing game (1FPS)

Created on 26 Mar 2018  路  11Comments  路  Source: acemod/ACE3

Arma 3 Version: 1.80 (stable)
CBA Version: 3.6.1 (stable)
ACE3 Version: 3.12.1 (stable)

Mods:

- CBA_A3
- ace

Description:
With ace_rearm_supply = 2 and adding function ace_rearm_fnc_addVehicleMagazinesToSupply to supply vehicle popups script error in line 6:
Error allTurrets: Type String, expected Array, Object

Steps to reproduce:

  • Add supply vehicle and combat vehiclel like tank.
  • Give appropriate variable names to use in script
  • Add [ammo_truck, tank] call ace_rearm_fnc_addVehicleMagazinesToSupply; to supply vehicle
  • Start into singleplayer mission test and see a pop up of script error and huge freezes.

Where did the issue occur?

  • Editor (Singleplayer) / Editor (Multiplayer)

RPT log file:
ACE Debug: https://pastebin.com/9ssgpTw1
RPT: https://drive.google.com/open?id=1d0Ful53nQLvrCyW3Shn5iw4GSU00TR5c

kinbug

All 11 comments

Needs RPT file.

Added RPT but it is 7MB of spam.

[ACE] (ui) INFO: Attempted modification of a forced User Interface element 'ammocount' by 'ace_reload'.
Spam indeed. WTF happened to your Arma :D
But the RPT doesn't help much anyway. Already found the error.

Weird mission? What happens on an empty mission.

Can you explain your post in more detail, dedmen?

What more detail? addVehicleMagazinesToSupply forces _vehicle variable to contain the classname.
and calls getAllRearmTurrets with that classname. But getAllRearmTurrets only accepts object as parameter.
Simple case of passing the wrong parameter type.

addVehicleMagazinesToSupply
https://github.com/acemod/ACE3/blob/0644ad9ca2fadd28711dd614be296542a834bc3e/addons/rearm/functions/fnc_addVehicleMagazinesToSupply.sqf#L7
We just cannot accept string here. And remove the
https://github.com/acemod/ACE3/blob/0644ad9ca2fadd28711dd614be296542a834bc3e/addons/rearm/functions/fnc_addVehicleMagazinesToSupply.sqf#L28-L31

I wonder what causing so much spam in RPT and such low FPS in what looks like a simple script error.

The error is not what's causing your RPT spam.

But it is. At least i got it every time, i am doing repro written above.

Because the function is running in the EGVAR(common,runAtSettingsInitialized) pushBack array, when the error happens it breaks the entire loop and keeps re-running the init chain each time.

Can reproduce by just doing
```
["CBA_settingsInitialized", {diag_log "here"; allTurrets "x"}] call cba_fnc_addEventHandler;
````
and it will spam forever. Code that goes into execNextFrame needs to be error free.

Was this page helpful?
0 / 5 - 0 ratings