Skip to content

Commit

Permalink
Tazer healing bugfix (#482)
Browse files Browse the repository at this point in the history
* Tazer healing bug fix

* Fix

* Revert

* Moved a check
  • Loading branch information
DomT602 authored Sep 15, 2018
1 parent 9de71f2 commit 9c2dc48
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions Altis_Life.Altis/core/functions/fn_handleDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,29 @@ params [
["_index",0,[0]]
];

//Handle the tazer first (Top-Priority).
if (!isNull _source) then {
if (_source != _unit) then {
if (!isNull _source && {_source != _unit}) then {
if (side _source isEqualTo west) then {
if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
_damage = 0;
if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
private ["_distance"];
_distance = 35;
if (_projectile == "B_556x45_dual") then {_distance = 100;};
if (alive _unit) then {
if (playerSide isEqualTo civilian && {!life_is_tazed}) then {
private _distance = 35;
if (_projectile isEqualTo "B_556x45_dual") then {_distance = 100};
if (_unit distance _source < _distance) then {
if !(isNull objectParent player) then {
if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
player action ["Eject",vehicle player];
if !(isNull objectParent _unit) then {
if (typeOf (vehicle _unit) isEqualTo "B_Quadbike_01_F") then {
_unit action ["Eject",vehicle _unit];
[_unit,_source] spawn life_fnc_tazed;
};
} else {
[_unit,_source] spawn life_fnc_tazed;
};
};
};
};

//Temp fix for super tasers on cops.
if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
_damage = 0;
_damage = if (_part isEqualTo "") then {
damage _unit;
} else {
_unit getHit _part;
};
};
};
};
Expand Down

0 comments on commit 9c2dc48

Please sign in to comment.