Skip to content

Commit

Permalink
update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
MiszczuZPolski committed Dec 12, 2024
1 parent 4e46d44 commit 86a5888
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
24 changes: 10 additions & 14 deletions addons/chemical/functions/fnc_poison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ if ((goggles _unit in (missionNamespace getVariable [QGVAR(availGasmaskList), []
[QGVAR(handleGasMaskDur), _unit, _unit] call CBA_fnc_targetEvent;
};

if (_gasLevel == 0) exitWith {
_unit setVariable [QGVAR(CSGas), 30, true];
if (random 1 <= GVAR(tearGasDropChance)) then {
[QACEGVAR(hitreactions,dropWeapon), _unit, _unit] call CBA_fnc_targetEvent;
};
};

//Get max infection time
private _infectionTime = missionNamespace getVariable [QGVAR(infectionTime), 60];

Expand All @@ -52,18 +59,7 @@ if (_currentInfection != _newTime) then {
_unit setVariable [QGVAR(infectionTime), _newTime, true];
};

// Exit if infection reaches 0 or the unit is dead
// Exit if infection reaches 0
if (_newTime <= 0) then {
switch (_gasLevel) do {
case 0: {
_unit setVariable [QGVAR(CSGas), 30, true];
if (random 1 <= GVAR(tearGasDropChance)) then {
[QACEGVAR(hitreactions,dropWeapon), _unit, _unit] call CBA_fnc_targetEvent;
};
};
case 1: {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
default {};
};
};
_unit setVariable [QGVAR(airPoisoning), true, true];
};
2 changes: 1 addition & 1 deletion addons/vitals/functions/fnc_handlePoisoning.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ if !(_unit getVariable [QEGVAR(chemical,airPoisoning), false]) then {
_unit setVariable [QEGVAR(chemical,infectionTime), _updateTime, true];
} else {
_unit setVariable [QEGVAR(chemical,infectionTime), 0, true];
};
};

0 comments on commit 86a5888

Please sign in to comment.