Missing privates. Lazy evaluation.

This commit is contained in:
Magnetar 2019-03-17 21:26:15 +01:00
parent 934339d1df
commit 89927a8b94
6 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@
if !(alive _this) exitWith {false}; if !(alive _this) exitWith {false};
private _bloodLoss = GET_BLOOD_LOSS(_this); private _bloodLoss = GET_BLOOD_LOSS(_this);
private _pain = GET_PAIN_PERCEIVED(_this); private _pain = GET_PAIN_PERCEIVED(_this);
private _unconscious = IS_UNCONSCIOUS(_this); private _unconscious = IS_UNCONSCIOUS(_this);

View File

@ -33,7 +33,7 @@ private _classID = 0;
private _causes = GET_ARRAY(_entry >> "causes",[]); private _causes = GET_ARRAY(_entry >> "causes",[]);
private _causeLimping = GET_NUMBER(_entry >> "causeLimping",0); private _causeLimping = GET_NUMBER(_entry >> "causeLimping",0);
if (count _causes > 0) then { if !(_causes isEqualTo []) then {
GVAR(woundClassNames) pushBack _className; GVAR(woundClassNames) pushBack _className;
GVAR(woundsData) pushBack [_classID, _selections, _bleeding, _pain, [_minDamage, _maxDamage], _causes, _className, _causeLimping]; GVAR(woundsData) pushBack [_classID, _selections, _bleeding, _pain, [_minDamage, _maxDamage], _causes, _className, _causeLimping];
_classID = _classID + 1; _classID = _classID + 1;

View File

@ -96,14 +96,14 @@ private _woundsCreated = [];
_bodyPartVisParams set [[1,2,3,3,4,4] select _bodyPartNToAdd, true]; // Mark the body part index needs updating _bodyPartVisParams set [[1,2,3,3,4,4] select _bodyPartNToAdd, true]; // Mark the body part index needs updating
// Create a new injury. Format [ID, classID, bodypart, percentage treated, bleeding rate] // Create a new injury. Format [ID, classID, bodypart, percentage treated, bleeding rate]
_injury = [_woundID, _woundClassIDToAdd, _bodyPartNToAdd, 1, _injuryBleedingRate]; private _injury = [_woundID, _woundClassIDToAdd, _bodyPartNToAdd, 1, _injuryBleedingRate];
// The higher the nastiness likelihood the higher the change to get a painful and bloody wound // The higher the nastiness likelihood the higher the change to get a painful and bloody wound
private _nastinessLikelihood = linearConversion [0, 20, (_woundDamage / _thresholdWoundCount), 0.5, 30, true]; private _nastinessLikelihood = linearConversion [0, 20, (_woundDamage / _thresholdWoundCount), 0.5, 30, true];
private _bleedingModifier = 0.25 + 8 * exp ((random [-4.5, -5, -6]) / _nastinessLikelihood); private _bleedingModifier = 0.25 + 8 * exp ((random [-4.5, -5, -6]) / _nastinessLikelihood);
private _painModifier = 0.05 + 2 * exp (-2 / _nastinessLikelihood); private _painModifier = 0.05 + 2 * exp (-2 / _nastinessLikelihood);
_bleeding = _injuryBleedingRate * _bleedingModifier; private _bleeding = _injuryBleedingRate * _bleedingModifier;
private _pain = _injuryPain * _painModifier; private _pain = _injuryPain * _painModifier;
_painLevel = _painLevel + _pain; _painLevel = _painLevel + _pain;

View File

@ -32,7 +32,7 @@ if (_hitPoint isEqualTo "") then {
}; };
// Damage can be disabled with old variable or via sqf command allowDamage // Damage can be disabled with old variable or via sqf command allowDamage
if !(isDamageAllowed _unit && _unit getVariable [QEGVAR(medical,allowDamage), true]) exitWith {_oldDamage}; if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {_oldDamage};
// Damages are stored for "ace_hdbracket" event triggered last // Damages are stored for "ace_hdbracket" event triggered last
private _newDamage = _damage - _oldDamage; private _newDamage = _damage - _oldDamage;

View File

@ -25,7 +25,7 @@ private _options = ["triage" , "examine", "bandage", "medication", "airway", "ad
for "_idc" from START_IDC to END_IDC step 1 do { for "_idc" from START_IDC to END_IDC step 1 do {
private _amount = [ACE_player, GVAR(INTERACTION_TARGET), _options select (_idc - START_IDC)] call FUNC(getTreatmentOptions); private _amount = [ACE_player, GVAR(INTERACTION_TARGET), _options select (_idc - START_IDC)] call FUNC(getTreatmentOptions);
if ((count _amount) > 0 || _idc == START_IDC || _idc == END_IDC) then { if (!(_amount isEqualTo []) || {_idc == START_IDC} || {_idc == END_IDC}) then {
(_display displayCtrl _idc) ctrlSettextColor [1, 1, 1, 1]; (_display displayCtrl _idc) ctrlSettextColor [1, 1, 1, 1];
} else { } else {
(_display displayCtrl _idc) ctrlSettextColor [0.4, 0.4, 0.4, 1]; (_display displayCtrl _idc) ctrlSettextColor [0.4, 0.4, 0.4, 1];

View File

@ -18,7 +18,7 @@ params ["_caller", "_target", "_bodyPart"];
private _heartRate = 0; private _heartRate = 0;
if (alive _target && !([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then { if (alive _target && {!([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then {
_heartRate = GET_HEART_RATE(_target); _heartRate = GET_HEART_RATE(_target);
}; };