Zero divisor when advance throwing Chemlight (IR)
Arma 3 Version: Stable (stable / rc / dev)
CBA Version: 3.3 (stable / dev + commit hash)
ACE3 Version: 3.9.2 (stable / dev + commit hash)
Mods:
- CBA_A3
- ace
Description:
- When advance throwing a Chemlight IR there is a zero divisor in fnc_exitThrowMode.sqf
[QEGVAR(common,setShotParents), [_activeThrowable, _unit, (getShotParents _activeThrowable) select 1]] call CBA_fnc_serverEvent;
variable _activeThrowable is in weird form: 8d881600# 178009. While others are on the form 1779997. So getShotParents returns a blank array.
The variable is being distorted in fnc_prime here:
// Throw Fired XEH
[QGVAR(throwFiredXEH), [
_unit, // unit
"Throw", // weapon
_muzzle, // muzzle
_muzzle, // mode
_throwableType, // ammo
_throwableMag, // magazine
_activeThrowable // projectile
]] call CBA_fnc_globalEvent;
Steps to reproduce:
- Open editor
- Spawn soldier with Chemlight IR
- Start advance throwing them
Where did the issue occur?
- Editor (Singleplayer)
Placed Modules:
- None
RPT log file:
This was introduced in #5052 it seems.
So CBA_fnc_addeventhandler is taking code as its second parameter.
Should it then be: _this call FUNC(throwFiredXEH) or just call FUNC(throwFiredXEH)?
Because now its just FUNC(throwFiredXEH)
Also is CBA_fnc_serverEvent still a thing? or should it be CBA_fnc_globalEvent. https://github.com/acemod/ACE3/blob/master/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf#L37
#5209 possible fix, missing call
Hope you fix it with that. I still think its a mystery that QGVAR(activeThrowable) get changed in the global event:
prime.sqf
systemChat format ["Before globalevent getvar: %1",_unit getVariable [QGVAR(activeThrowable), objNull]];
// Throw Fired XEH
[QGVAR(throwFiredXEH), [
_unit, // unit
"Throw", // weapon
_muzzle, // muzzle
_muzzle, // mode
_throwableType, // ammo
_throwableMag, // magazine
_activeThrowable // projectile
]] call CBA_fnc_globalEvent;
systemChat format ["After globalevent getvar: %1",_unit getVariable [QGVAR(activeThrowable), objNull]];
ExitThrowMode.sqf
systemChat format ["ExitThrowMode _activeThrowable: %1", _activeThrowable];
Picture of the logg: https://drive.google.com/file/d/0B29KgFH6HzdIZ3JPNmNqak5HMDQ/view?usp=sharing
Take a look at https://github.com/acemod/ACE3/blob/master/addons/chemlights/functions/fnc_throwIR.sqf
It deletes the old grenade, creates a new one then changes the variable back in advanced throwing.
Aa thanks.
That explains alot :)