HuntIR - Use ammo event handler (#9561)

This commit is contained in:
PabstMirror 2023-10-23 12:04:00 -05:00 committed by GitHub
parent 17daea0ff8
commit 9160826faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -5,6 +5,9 @@ class CfgAmmo {
lightColor[] = {0, 0, 0, 0}; lightColor[] = {0, 0, 0, 0};
smokeColor[] = {0, 0, 0, 0}; smokeColor[] = {0, 0, 0, 0};
timeToLive = 6; timeToLive = 6;
class Eventhandlers {
fired = QUOTE(call FUNC(handleFired));
};
}; };
class ShellBase; class ShellBase;

View File

@ -8,8 +8,4 @@ GVAR(cur_cam) = 0;
GVAR(ROTATE) = 0; GVAR(ROTATE) = 0;
GVAR(ELEVAT) = 0.01; GVAR(ELEVAT) = 0.01;
// Register fire event handler
// Don't run for non players, as they are too dumb to launch huntirs anyway
["ace_firedPlayer", DFUNC(handleFired)] call CBA_fnc_addEventHandler;
["ace_huntir", {!GETMVAR(GVAR(stop),true)}] call CBA_fnc_registerFeatureCamera; ["ace_huntir", {!GETMVAR(GVAR(stop),true)}] call CBA_fnc_registerFeatureCamera;

View File

@ -16,12 +16,11 @@
* Public: No * Public: No
*/ */
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; params ["_unit", "", "", "", "", "", "_projectile"];
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret); TRACE_2("handleFired",_unit,_projectile);
if (_ammo != "F_HuntIR") exitWith {}; // Don't run for non players, as they are too dumb to launch huntirs anyway
if (_unit != ACE_player) exitWith {};
if (!hasInterface) exitWith {};
[{ [{
params ["_projectile"]; params ["_projectile"];