Skip to content

Commit

Permalink
Merge pull request #15 from diwako/fix_friendly_fire_detection
Browse files Browse the repository at this point in the history
fix friendly fire detection for zeus controlled units
  • Loading branch information
diwako authored Jun 26, 2021
2 parents 233c5fb + 944da30 commit b76c652
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addons/main/functions/fnc_handleDamageEh.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ _hitPoint = [_hitPoint, "hit", ""] call CBA_fnc_replace;
private _var = format ["GVAR(lastHandleDamage)$%1", _hitPoint];
if ((_unit getVariable [_var, -1]) isEqualTo _realDamage) exitWith {_curDamage};
_unit setVariable [_var, _realDamage];
[_unit, _realDamage, _hitPoint, [_instigator, _source] select (isNull _instigator)] call FUNC(receiveDamage);
[_unit, _realDamage, _hitPoint, [_source, _instigator] select (isNull _source)] call FUNC(receiveDamage);
0
6 changes: 3 additions & 3 deletions addons/main/functions/fnc_handleDamageEhACE.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ if (_hitPoint isEqualTo "") then {
if (!isDamageAllowed _unit || {_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"] || {_unit getVariable ["ace_medical_allowDamage", false]}}) exitWith {_curDamage};

if (GVAR(disallowFriendfire) &&
{!isNull _instigator && {
_instigator isNotEqualTo _unit && {
(side group _unit) isEqualTo (side group _instigator)}}}) exitWith {_curDamage};
{!isNull _shooter && {
_shooter isNotEqualTo _unit && {
(side group _unit) isEqualTo (side group _shooter)}}}) exitWith {_curDamage};

private _newDamage = _damage - _curDamage;
if (_newDamage isEqualTo 0) exitWith {
Expand Down
2 changes: 1 addition & 1 deletion addons/main/functions/fnc_hitEh.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if (isNull _instigator) exitWith {
};
};

[_unit, _damage, "body", [_instigator, _source] select (isNull _instigator)] call FUNC(receiveDamage);
[_unit, _damage, "body", [_source, _instigator] select (isNull _source)] call FUNC(receiveDamage);

0 comments on commit b76c652

Please sign in to comment.