diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 9dc711a5a7..42a94997d8 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -18,7 +18,7 @@ private "_vehicle"; params ["_caller", "_target"]; if ([_target] call EFUNC(common,isAwake)) exitwith { - ["displayTextStructured", [_caller], [[localize LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); + ["displayTextStructured", [_caller], [[LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { [_caller, _target] call EFUNC(dragging,dropObject_carry); diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 2a39b63095..b920f276f0 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -24,7 +24,7 @@ _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; // Check if there is a tourniquet on this bodypart if ((_tourniquets select _part) == 0) exitwith { - _output = localize LSTRING(noTourniquetOnBodyPart); + _output = LSTRING(noTourniquetOnBodyPart); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); }; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index fff615a5b3..9cac3af5f2 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -25,11 +25,8 @@ if (!local _unit) exitwith { date params ["", "", "", "_minute", "_hour"]; -_moment = if (_minute < 10) then { - format["%1:0%2", _hour, _minute] -} else { - format["%1:%2", _hour, _minute] -}; +_moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute] + _logVarName = format[QGVAR(logFile_%1), _type]; _log = _unit getvariable [_logVarName, []]; diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index e1817d21fe..ff191ea7ca 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -22,11 +22,8 @@ params ["_caller", "_target", "_selectionName", "_className"]; if !(_target isKindOf "CAManBase") exitWith { false }; -_config = if (GVAR(level)>=2) then { - (ConfigFile >> "ACE_Medical_Actions" >> "Advanced" >> _className) -} else { - (ConfigFile >> "ACE_Medical_Actions" >> "Basic" >> _className) -}; +_config = (ConfigFile >> "ACE_Medical_Actions" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className); + if !(isClass _config) exitwith {false}; _medicRequired = if (isNumber (_config >> "requiredMedic")) then { diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 934bcc72dc..f73376cb29 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -21,8 +21,8 @@ if (GVAR(level) < 2) exitWith {}; private ["_amountOfGeneric", "_bandagedwounds", "_logCtrl", "_part", "_partText", "_pointDamage", "_severity", "_total", "_totalIvVolume", "_triageStatus", "_type"]; params ["_target", ["_show", true], ["_selectionN", 0]]; -GVAR(currentSelectedSelectionN) = if (typeName _selectionN == "SCALAR") then {_selectionN} else {0}; -GVAR(displayPatientInformationTarget) = if (_show) then {_target} else {ObjNull}; +GVAR(currentSelectedSelectionN) = [0, _selectionN] select (IS_SCALAR(_selectionN)); +GVAR(displayPatientInformationTarget) = [ObjNull, _target] select _show; if (USE_WOUND_EVENT_SYNC) then { [_target, ACE_player] call FUNC(requestWoundSync); diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index d0aff19cc4..afa687f137 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -15,17 +15,16 @@ params ["_typeOfProjectile"]; -call { - if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; - if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; - if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "FuelExplosion") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "ShellBase") exitWith {"shell"}; - if (_typeOfProjectile isKindOf "RocketBase") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "MissileBase") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "LaserBombCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; - if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; - toLower _typeOfProjectile -} + +if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; +if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; +if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "FuelExplosion") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "ShellBase") exitWith {"shell"}; +if (_typeOfProjectile isKindOf "RocketBase") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "MissileBase") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "LaserBombCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "BombCore") exitWith {"explosive"}; +if (_typeOfProjectile isKindOf "Grenade") exitWith {"grenade"}; +toLower _typeOfProjectile diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 444643c806..1f484ab056 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -32,11 +32,11 @@ if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0}; // Exit if we disable damage temporarily if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { - _damageOld = damage _unit; if (_selection in GVAR(SELECTIONS)) then { - _damageOld = _unit getHit _selection; + _unit getHit _selection + } else { + damage _unit }; - _damageOld; }; // Get return damage @@ -47,9 +47,10 @@ _newDamage = _this call FUNC(handleDamage_caching); _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); -_minLethalDamage = 0.01; -if (_typeIndex >= 0) then { - _minLethalDamage = GVAR(minLethalDamages) select _typeIndex; +_minLethalDamage = if (_typeIndex >= 0) then { + GVAR(minLethalDamages) select _typeIndex +} else { + 0.01 }; if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then {