Skip to content

Commit

Permalink
apply deathChance setting to AI as well as players
Browse files Browse the repository at this point in the history
  • Loading branch information
blake8090 committed Oct 8, 2023
1 parent 78bb051 commit 5f3b2d4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addons/medical_damage/functions/fnc_woundsHandlerBase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra
if (_bodyPart isEqualTo "head" || {_bodyPart isEqualTo "body" && {_woundDamage > PENETRATION_THRESHOLD}}) then {
_criticalDamage = true;
};

if ([_unit, _bodyPartNToAdd, _bodyPartDamage, _woundDamage] call FUNC(determineIfFatal)) then {
if (!isPlayer _unit || {random 1 < EGVAR(medical,deathChance)}) then {
TRACE_1("determineIfFatal returned true",_woundDamage);
TRACE_1("Fatal damage",_woundDamage);
// TODO: Add separate settings for player and AI death chances
private _deathChance = EGVAR(medical,deathChance);
if (random 1 < _deathChance) then {
TRACE_1("Fatal injury",_deathChance);
[QEGVAR(medical,FatalInjury), _unit] call CBA_fnc_localEvent;
};
};
Expand Down

0 comments on commit 5f3b2d4

Please sign in to comment.