mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Revert "Exposed projectile event handlers for both blacklist use and other shenanigans."
This reverts commit eaff498f3f
.
This commit is contained in:
parent
eaff498f3f
commit
f1483c59c3
@ -19,5 +19,3 @@ params ["_projectile"];
|
|||||||
TRACE_1("addBlackList",_projectile);
|
TRACE_1("addBlackList",_projectile);
|
||||||
|
|
||||||
_projectile setVariable [QGVAR(blacklisted), true, true];
|
_projectile setVariable [QGVAR(blacklisted), true, true];
|
||||||
_projectile removeEventHandler ["HitPart", _projectile getVariable [QGVAR(hitPartEH), -1]];
|
|
||||||
_projectile removeEventHandler ["Explode", _projectile getVariable [QGVAR(explodeEH), -1]];
|
|
@ -21,17 +21,20 @@ if (!isServer) exitWith {};
|
|||||||
params ["_projectile"];
|
params ["_projectile"];
|
||||||
|
|
||||||
private _ammo = typeOf _projectile;
|
private _ammo = typeOf _projectile;
|
||||||
if (_ammo isEqualTo "" || {isNull _projectile}
|
if (_ammo isEqualTo "" || {isNull _projectile}) exitWith {
|
||||||
|| {_projectile getVariable [QGVAR(blacklisted), false]}) exitWith {
|
TRACE_2("bad ammo or projectile",_ammo,_projectile);
|
||||||
TRACE_2("bad ammo or projectile, or blackList",_ammo,_projectile);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {};
|
||||||
|
|
||||||
if (GVAR(enabled) && {_ammo call FUNC(shouldFrag)}) then {
|
if (GVAR(enabled) && {_ammo call FUNC(shouldFrag)}) then {
|
||||||
private _explodeEH = _projectile addEventHandler [
|
_projectile addEventHandler [
|
||||||
"Explode",
|
"Explode",
|
||||||
{
|
{
|
||||||
params ["_projectile", "_posASL", "_velocity"];
|
params ["_projectile", "_posASL", "_velocity"];
|
||||||
|
|
||||||
|
if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {};
|
||||||
|
|
||||||
private _shotParents = _projectile getVariable [QGVAR(shotParent), getShotParents _projectile];
|
private _shotParents = _projectile getVariable [QGVAR(shotParent), getShotParents _projectile];
|
||||||
private _ammo = typeOf _projectile;
|
private _ammo = typeOf _projectile;
|
||||||
// wait for frag damage to kill units before spawning fragments
|
// wait for frag damage to kill units before spawning fragments
|
||||||
@ -44,15 +47,16 @@ if (GVAR(enabled) && {_ammo call FUNC(shouldFrag)}) then {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
_projectile setVariable [QGVAR(explodeEH), _explodeEH];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then {
|
if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then {
|
||||||
private _hitPartEH = _projectile addEventHandler [
|
_projectile addEventHandler [
|
||||||
"HitPart",
|
"HitPart",
|
||||||
{
|
{
|
||||||
params ["_projectile", "_hitObject", "", "_posASL", "_velocity", "_surfNorm", "", "", "_surfType"];
|
params ["_projectile", "_hitObject", "", "_posASL", "_velocity", "_surfNorm", "", "", "_surfType"];
|
||||||
|
|
||||||
|
if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {};
|
||||||
|
|
||||||
// starting v2.18 it may be faster to use the instigator parameter, the same as the second entry shotParents, to recreate _shotParent
|
// starting v2.18 it may be faster to use the instigator parameter, the same as the second entry shotParents, to recreate _shotParent
|
||||||
// The "explode" EH does not get the same parameter
|
// The "explode" EH does not get the same parameter
|
||||||
private _shotParent = getShotParents _projectile;
|
private _shotParent = getShotParents _projectile;
|
||||||
@ -68,7 +72,6 @@ if (GVAR(spallEnabled) && {_ammo call FUNC(shouldSpall)}) then {
|
|||||||
] call CBA_fnc_execNextFrame;
|
] call CBA_fnc_execNextFrame;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
_projectile setVariable [QGVAR(hitPartEH), _hitPartEH];
|
|
||||||
};
|
};
|
||||||
#ifdef DEBUG_MODE_DRAW
|
#ifdef DEBUG_MODE_DRAW
|
||||||
if (GVAR(debugOptions) && {_ammo call FUNC(shouldFrag) || {_ammo call FUNC(shouldSpall)}}) then {
|
if (GVAR(debugOptions) && {_ammo call FUNC(shouldFrag) || {_ammo call FUNC(shouldSpall)}}) then {
|
||||||
|
Loading…
Reference in New Issue
Block a user