Medical Feedback - Fix DISABLE_VANILLA_DAMAGE_EFFECTS (#6966)

* Medical Feedback - Fix DISABLE_VANILLA_DAMAGE_EFFECTS

* Keep compatibilty with old ace_medical_lastDamageSource var name
This commit is contained in:
PabstMirror 2019-04-27 14:04:31 -05:00 committed by GitHub
parent 50e3d8b3fe
commit 0d7709673a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 25 deletions

View File

@ -34,8 +34,8 @@ if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1",
_bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] select _bodyPartIndex; _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] select _bodyPartIndex;
if (!isNull _instigator) then { if (!isNull _instigator) then {
_unit setVariable [QEGVAR(medical_engine,lastShooter), _instigator]; _unit setVariable [QEGVAR(medical,lastDamageSource), _instigator];
_unit setVariable [QEGVAR(medical_engine,lastInstigator), _instigator]; _unit setVariable [QEGVAR(medical,lastInstigator), _instigator];
}; };
#ifdef DEBUG_TESTRESULTS #ifdef DEBUG_TESTRESULTS

View File

@ -20,7 +20,7 @@
_unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}] _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]
]; ];
}; };
}, nil, nil, true] call CBA_fnc_addClassEventHandler; }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
[QEGVAR(medical,woundReceived), { [QEGVAR(medical,woundReceived), {
@ -30,24 +30,6 @@
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;
#endif #endif
// Kill vanilla bleeding feedback effects.
#ifdef DISABLE_VANILLA_DAMAGE_EFFECTS
[{
{isNil _x} count [
"BIS_fnc_feedback_damageCC",
"BIS_fnc_feedback_damageRadialBlur",
"BIS_fnc_feedback_damageBlur"
] == 0
}, {
{
ppEffectDestroy _x;
} forEach [
BIS_fnc_feedback_damageCC,
BIS_fnc_feedback_damageRadialBlur,
BIS_fnc_feedback_damageBlur
];
}] call CBA_fnc_waitUntilAndExecute;
#endif
// this handles moving units into vehicles via load functions or zeus // this handles moving units into vehicles via load functions or zeus
// needed, because the vanilla INCAPACITATED state does not handle vehicles // needed, because the vanilla INCAPACITATED state does not handle vehicles

View File

@ -45,8 +45,8 @@ if (_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"]) exitWith {_oldDa
// This hitpoint is set to trigger last, evaluate all the stored damage values // This hitpoint is set to trigger last, evaluate all the stored damage values
// to determine where wounds are applied // to determine where wounds are applied
if (_hitPoint isEqualTo "ace_hdbracket") exitWith { if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
_unit setVariable [QGVAR(lastShooter), _shooter]; _unit setVariable [QEGVAR(medical,lastDamageSource), _shooter];
_unit setVariable [QGVAR(lastInstigator), _instigator]; _unit setVariable [QEGVAR(medical,lastInstigator), _instigator];
private _damageStructural = _unit getVariable [HIT_STRUCTURAL, 0]; private _damageStructural = _unit getVariable [HIT_STRUCTURAL, 0];

View File

@ -151,3 +151,6 @@
// Cache expiry values, in seconds // Cache expiry values, in seconds
#define IN_MEDICAL_FACILITY_CACHE_EXPIRY 1 #define IN_MEDICAL_FACILITY_CACHE_EXPIRY 1
#define CAN_TREAT_CONDITION_CACHE_EXPIRY 2 #define CAN_TREAT_CONDITION_CACHE_EXPIRY 2
// Ignore UAV/Drone AI Base Classes
#define IGNORE_BASE_UAVPILOTS "B_UAV_AI", "O_UAV_AI", "UAV_AI_base_F"

View File

@ -70,3 +70,24 @@ GVAR(heartBeatEffectRunning) = false;
[_status, 0] call FUNC(effectUnconscious); [_status, 0] call FUNC(effectUnconscious);
["unconscious", _status] call EFUNC(common,setDisableUserInputStatus); ["unconscious", _status] call EFUNC(common,setDisableUserInputStatus);
}] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addPlayerEventHandler;
// Kill vanilla bleeding feedback effects.
#ifdef DISABLE_VANILLA_DAMAGE_EFFECTS
TRACE_1("disabling vanilla bleeding feedback effects",_this);
[{
{isNil _x} count [
"BIS_fnc_feedback_damageCC",
"BIS_fnc_feedback_damageRadialBlur",
"BIS_fnc_feedback_damageBlur"
] == 0
}, {
{
ppEffectDestroy _x;
} forEach [
BIS_fnc_feedback_damageCC,
BIS_fnc_feedback_damageRadialBlur,
BIS_fnc_feedback_damageBlur
];
}] call CBA_fnc_waitUntilAndExecute;
#endif

View File

@ -22,7 +22,7 @@ _unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
// Kill the unit without changing visual apperance // Kill the unit without changing visual apperance
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage); [_unit, 1] call EFUNC(medical_engine,setStructuralDamage);
private _lastShooter = _unit getVariable [QEGVAR(medical_engine,lastShooter), objNull]; private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
private _lastInstigator = _unit getVariable [QEGVAR(medical_engine,lastInstigator), objNull]; private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent; ["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;