Can no longer go below zero

This commit is contained in:
Glowbal 2015-03-03 19:58:58 +01:00
parent 8f76832177
commit 83cdef770a
2 changed files with 2 additions and 2 deletions

View File

@ -85,7 +85,7 @@ _viscosityAdjustment = _viscosityChange / _timeInSystem;
_amountDecreased = _amountDecreased + _decreaseAmount;
// Restoring the viscosity while the medication is leaving the system
_target setvariable [QGVAR(peripheralResistance), (_target getvariable [QGVAR(peripheralResistance), 100]) - _viscosityAdjustment];
_target setvariable [QGVAR(peripheralResistance), ((_target getvariable [QGVAR(peripheralResistance), 100]) - _viscosityAdjustment) max 0];
if (_amountDecreased >= 1 || (_usedMeds <= 0) || !alive _target) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;

View File

@ -74,7 +74,7 @@ _target setvariable [QGVAR(pain), _pain];
_resistance = _unit getvariable [QGVAR(peripheralResistance), 100];
_resistance = _resistance + _viscosityChange;
_unit setvariable [QGVAR(peripheralResistance), _resistance];
_unit setvariable [QGVAR(peripheralResistance), _resistance max 0];
// Call back to ensure that the medication is decreased over time
[_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange] call FUNC(onMedicationUsage);