Skip to content

Commit

Permalink
Chemical - Fix Zoning Issues with the JCAD (#662)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- Fixes Intensity not being reset when a player exits a chemical zone

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.

---------

Co-authored-by: MiszczuZPolski <[email protected]>
  • Loading branch information
mazinskihenry and MiszczuZPolski authored Dec 16, 2024
1 parent 6e5395f commit 8c7d0c4
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion addons/vitals/functions/fnc_handlePoisoning.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@ private _currentCS = _unit getVariable [QEGVAR(chemical,CSGas), 0];

_unit setVariable [QEGVAR(chemical,CSGas), (_currentCS - (_poisonAdjustment * _deltaT)) max 0, _syncValue];

private _inZone = false;
private _distance = 0;

{
_y params ["_gasLogic", "_radius", "_gasLevel", "_condition", "_conditionArgs", "_isSealable"];
TRACE_2("gasVitalsPFH loop",_x,_y);

_distance = _unit distance _gasLogic;

if (_distance < _radius) then {
_inZone = true;
};
} forEach GVAR(gasSources);

if !(_inZone) then {
_unit setVariable [QGVAR(areaIntensity), 0, true];
};

private _infectionArray = _unit getVariable [QEGVAR(chemical,infectionArray), []];

if (count _infectionArray == 0) then {
Expand All @@ -45,4 +63,4 @@ if (count _infectionArray == 0) then {
} forEach _infectionArray;

_unit setVariable [QEGVAR(chemical,infectionArray), _infectionArray, true];
};
};

0 comments on commit 8c7d0c4

Please sign in to comment.