mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improvements and fixes for injured loop and enabledFor check
This commit is contained in:
parent
8215abb69d
commit
10f30fa543
@ -3,6 +3,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitwith{};
|
||||
GVAR(enabledFor) = 1; // TODO remove this once we implement settings. Just here to get the vitals working.
|
||||
|
||||
GVAR(heartBeatSounds_Fast) = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "ACE_heartbeat_fast_3"];
|
||||
GVAR(heartBeatSounds_Normal) = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"];
|
||||
|
@ -15,15 +15,16 @@
|
||||
|
||||
private "_unit";
|
||||
_unit = _this select 0;
|
||||
if !(local _unit) exitwith{
|
||||
[[_unit], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
};
|
||||
|
||||
if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{
|
||||
_unit setvariable [QGVAR(addedToUnitLoop),true, true];
|
||||
};
|
||||
if ([_unit] call FUNC(hasMedicalEnabled) || true) then {
|
||||
|
||||
if !(local _unit) exitwith{
|
||||
[[_unit], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
};
|
||||
if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{
|
||||
_unit setvariable [QGVAR(addedToUnitLoop),true, true];
|
||||
};
|
||||
|
||||
if ([_unit] call FUNC(hasMedicalEnabled)) then {
|
||||
[{
|
||||
private "_unit";
|
||||
_unit = (_this select 0) select 0;
|
||||
|
@ -24,7 +24,7 @@ if (GVAR(level) >= 1) then {
|
||||
//_cardiacOutput = [_this] call FUNC(getCardiacOutput);
|
||||
|
||||
{
|
||||
if ((_tourniquets select (_x select 2)) < 1) then {
|
||||
if ((_tourniquets select (_x select 2)) == 0) then {
|
||||
// total bleeding ratio * percentage of injury left
|
||||
_totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3));
|
||||
|
||||
|
@ -60,6 +60,7 @@ if (GVAR(level) >= 1) then {
|
||||
};
|
||||
};
|
||||
};
|
||||
[_unit] call FUNC(addToInjuredCollection);
|
||||
|
||||
if (_unit getVariable [QGVAR(preventDeath), false] && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {
|
||||
if (vehicle _unit != _unit and {damage _vehicle >= 1}) then {
|
||||
|
@ -36,7 +36,7 @@ _allInjuriesForDamageType = _injuryTypeInfo select 2;
|
||||
|
||||
// find the available injuries for this damage type and damage amount
|
||||
_highestPossibleSpot = -1;
|
||||
_highestPossibleDamage = 0;
|
||||
_highestPossibleDamage = -1;
|
||||
_allPossibleInjuries = [];
|
||||
{
|
||||
_minDamage = _x select 4;
|
||||
@ -82,7 +82,7 @@ _woundsCreated = [];
|
||||
for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do {
|
||||
|
||||
// Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage]
|
||||
_toAddInjury = if (random(1) >= 0.5) then {_allPossibleInjuries select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));};
|
||||
_toAddInjury = if (random(1) >= 0.5) then {_allInjuriesForDamageType select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));};
|
||||
_toAddClassID = _toAddInjury select 0;
|
||||
_foundIndex = -1;
|
||||
|
||||
|
@ -15,7 +15,7 @@ _unit = _this select 0;
|
||||
|
||||
_medicalEnabled = _unit getvariable QGVAR(enableMedical);
|
||||
if (isnil "_medicalEnabled") exitwith {
|
||||
(((GVAR(setting_enableForUnits) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(setting_enableForUnits) == 1));
|
||||
(((GVAR(enabledFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enabledFor) == 1));
|
||||
};
|
||||
|
||||
_medicalEnabled;
|
||||
|
Loading…
Reference in New Issue
Block a user