ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

Zero divisor when advance throwing Chemlight (IR)

Open Phyma opened this issue 9 years ago • 7 comments

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:

  • Add a link (gist or pastebin) to the client and/or server RPT file. An instruction to find your RPT files can be found here.
  • If possible at the time the bug is encountered, go to ACE Options and select "Debug To Clipboard", this will print extensive debug information to the RPT file.

Phyma avatar May 26 '17 22:05 Phyma

This was introduced in #5052 it seems.

jonpas avatar May 27 '17 00:05 jonpas

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)

Phyma avatar May 27 '17 00:05 Phyma

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

Phyma avatar May 27 '17 00:05 Phyma

#5209 possible fix, missing call

Phyma avatar May 27 '17 00:05 Phyma

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

Phyma avatar May 27 '17 01:05 Phyma

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.

PabstMirror avatar May 27 '17 01:05 PabstMirror

Aa thanks.

That explains alot :)

Phyma avatar May 27 '17 01:05 Phyma