fix exitWith capitalization

This commit is contained in:
commy2 2015-11-30 17:14:05 +01:00
parent 0b84bb514b
commit 34d351c652
103 changed files with 235 additions and 235 deletions

View File

@ -19,7 +19,7 @@
params ["_unit","_state"]; params ["_unit","_state"];
TRACE_2("params",_unit,_state); TRACE_2("params",_unit,_state);
if (!local _unit) exitwith { if (!local _unit) exitWith {
ERROR("running setHandcuffed on remote unit"); ERROR("running setHandcuffed on remote unit");
}; };
if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith { if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith {

View File

@ -19,7 +19,7 @@
params ["_unit","_state"]; params ["_unit","_state"];
TRACE_2("params",_unit,_state); TRACE_2("params",_unit,_state);
if (!local _unit) exitwith { if (!local _unit) exitWith {
ERROR("running surrender on remote unit"); ERROR("running surrender on remote unit");
}; };

View File

@ -22,7 +22,7 @@ private ["_defaultLoglevel", "_defaultLogDisplayLevel"];
_defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL); _defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL);
if (_defaultLoglevel < 0) exitwith {false}; if (_defaultLoglevel < 0) exitWith {false};
_defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL); _defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL);

View File

@ -21,7 +21,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi
if (isNil "_defaultGlobal") exitWith {}; if (isNil "_defaultGlobal") exitWith {};
if (typeName _name != "STRING") exitwith { if (typeName _name != "STRING") exitWith {
[format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug);
}; };

View File

@ -97,7 +97,7 @@ if (_show) then {
_list pushBack [_iconId, _icon, _color, ACE_time]; _list pushBack [_iconId, _icon, _color, ACE_time];
} else { } else {
{ {
if (_x select 0 == _iconId) exitwith { if (_x select 0 == _iconId) exitWith {
_list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]]; _list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]];
}; };
} forEach _list; } forEach _list;

View File

@ -20,7 +20,7 @@
params ["_object", ["_category", ""]]; params ["_object", ["_category", ""]];
if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith {[]}; if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitWith {[]};
private ["_return", "_val"]; private ["_return", "_val"];

View File

@ -17,7 +17,7 @@ params ["_varName"];
private "_variableDefinition"; private "_variableDefinition";
_variableDefinition = [_varName] call FUNC(getDefinedVariableInfo); _variableDefinition = [_varName] call FUNC(getDefinedVariableInfo);
if !(_variableDefinition isEqualTo []) exitwith { if !(_variableDefinition isEqualTo []) exitWith {
_variableDefinition select 1; _variableDefinition select 1;
}; };

View File

@ -21,7 +21,7 @@ private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"];
_vehicle = objNull; _vehicle = objNull;
if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitwith {_vehicle}; if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle};
_loadcar = nearestObject [_unit, "Car"]; _loadcar = nearestObject [_unit, "Car"];

View File

@ -16,7 +16,7 @@ private "_fnc_parseConfigForDisplayNames";
_fnc_parseConfigForDisplayNames = { _fnc_parseConfigForDisplayNames = {
params ["_optionEntry"]; params ["_optionEntry"];
if !(isClass _optionEntry) exitwith {false}; if !(isClass _optionEntry) exitWith {false};
private "_values"; private "_values";
_values = getArray (_optionEntry >> "values"); _values = getArray (_optionEntry >> "values");

View File

@ -23,7 +23,7 @@ if (isNil "_global") then {
_definedVariable params ["", "", ["_global", false]]; _definedVariable params ["", "", ["_global", false]];
}; };
if (!isNil "_value") exitwith { if (!isNil "_value") exitWith {
_unit setVariable [_variable, _value, _global]; _unit setVariable [_variable, _value, _global];
}; };

View File

@ -27,7 +27,7 @@ if (_switch) then {
_previousGroup = group _unit; _previousGroup = group _unit;
_originalSide = side group _unit; _originalSide = side group _unit;
if (count units _previousGroup == 1 && _originalSide == _side) exitwith { if (count units _previousGroup == 1 && _originalSide == _side) exitWith {
[format ["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); [format ["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug);
}; };
@ -41,7 +41,7 @@ if (_switch) then {
private ["_currentGroup", "_newGroup"]; private ["_currentGroup", "_newGroup"];
{ {
if (_id == (_x select 2)) exitwith { if (_id == (_x select 2)) exitWith {
_x set [ 3, false]; _x set [ 3, false];
_previousGroupsList set [_forEachIndex, _x]; _previousGroupsList set [_forEachIndex, _x];
[format["found group with ID: %1", _id]] call FUNC(debug); [format["found group with ID: %1", _id]] call FUNC(debug);
@ -51,7 +51,7 @@ if (_switch) then {
reverse _previousGroupsList; reverse _previousGroupsList;
{ {
if (_x select 3) exitwith {}; // stop at first id set to true if (_x select 3) exitWith {}; // stop at first id set to true
if !(_x select 3) then { if !(_x select 3) then {
_currentGroup = group _unit; _currentGroup = group _unit;
if (!isNull (_x select 0)) then { if (!isNull (_x select 0)) then {

View File

@ -51,12 +51,12 @@ if (_vehicle isKindOf "Ship") then {
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if !(_validVehiclestate) exitwith { if !(_validVehiclestate) exitWith {
ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle); ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle);
false false
}; };
if (count _emptyPos == 0) exitwith { if (count _emptyPos == 0) exitWith {
ACE_LOGWARNING_1("No safe empty spots to unload patient. %1",_emptyPos); ACE_LOGWARNING_1("No safe empty spots to unload patient. %1",_emptyPos);
false false
}; //consider displaying text saying there are no safe places to exit the vehicle }; //consider displaying text saying there are no safe places to exit the vehicle

View File

@ -15,7 +15,7 @@
#include "script_component.hpp" #include "script_component.hpp"
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine // If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitWith {
[{ [{
_this call FUNC(dismount); _this call FUNC(dismount);
}, _this] call EFUNC(common,execNextFrame); }, _this] call EFUNC(common,execNextFrame);

View File

@ -29,7 +29,7 @@ private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevati
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa));
if (GVAR(noVectorData)) exitwith {}; if (GVAR(noVectorData)) exitWith {};
GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"]; GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"];
// Incase grids go neg due to 99-00 boundry // Incase grids go neg due to 99-00 boundry

View File

@ -20,7 +20,7 @@ params ["_caller", "_target"];
private "_display"; private "_display";
#define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" #define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa"
//Sanity Checks //Sanity Checks
if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");}; if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");};
if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");}; if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");};
if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;}; if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;};

View File

@ -57,7 +57,7 @@ _startingAmmoCounts = [];
}; };
} forEach (magazinesAmmoFull _player); } forEach (magazinesAmmoFull _player);
if ((count _startingAmmoCounts) < 2) exitwith {ERROR("Not Enough Mags to Repack");}; if ((count _startingAmmoCounts) < 2) exitWith {ERROR("Not Enough Mags to Repack");};
_simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simulateRepackEvents); _simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simulateRepackEvents);
_totalTime = (_simEvents select ((count _simEvents) - 1) select 0); _totalTime = (_simEvents select ((count _simEvents) - 1) select 0);

View File

@ -160,7 +160,7 @@ GVAR(lastHeartBeatSound) = ACE_time;
if (GVAR(level) == 1) then { if (GVAR(level) == 1) then {
_heartRate = 60 + 40 * _pain; _heartRate = 60 + 40 * _pain;
}; };
if (_heartRate <= 0) exitwith {}; if (_heartRate <= 0) exitWith {};
_interval = 60 / (_heartRate min 40); _interval = 60 / (_heartRate min 40);
if ((ACE_player getVariable ["ACE_isUnconscious", false])) then { if ((ACE_player getVariable ["ACE_isUnconscious", false])) then {
@ -246,7 +246,7 @@ GVAR(lastHeartBeatSound) = ACE_time;
}; };
["SettingsInitialized", { ["SettingsInitialized", {
if (GVAR(level) == 2) exitwith { if (GVAR(level) == 2) exitWith {
[ [
{(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)},
{(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9},

View File

@ -17,7 +17,7 @@
private "_vehicle"; private "_vehicle";
params ["_caller", "_target"]; params ["_caller", "_target"];
if ([_target] call EFUNC(common,isAwake)) exitwith { if ([_target] call EFUNC(common,isAwake)) exitWith {
["displayTextStructured", [_caller], [[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 { if ([_target] call FUNC(isBeingCarried)) then {

View File

@ -23,7 +23,7 @@ _part = [_selectionName] call FUNC(selectionNameToNumber);
_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
// Check if there is a tourniquet on this bodypart // Check if there is a tourniquet on this bodypart
if ((_tourniquets select _part) == 0) exitwith { if ((_tourniquets select _part) == 0) exitWith {
_output = LSTRING(noTourniquetOnBodyPart); _output = LSTRING(noTourniquetOnBodyPart);
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
}; };

View File

@ -18,7 +18,7 @@
params ["_caller", "_target", ["_drag", false]]; params ["_caller", "_target", ["_drag", false]];
// cannot unload a unit not in a vehicle. // cannot unload a unit not in a vehicle.
if (vehicle _target == _target) exitwith {}; if (vehicle _target == _target) exitWith {};
if (([_target] call EFUNC(common,isAwake))) exitwith {}; if (([_target] call EFUNC(common,isAwake))) exitWith {};
["unloadPersonEvent", _target, [_target, vehicle _target]] call EFUNC(common,targetEvent) ["unloadPersonEvent", _target, [_target, vehicle _target]] call EFUNC(common,targetEvent)

View File

@ -17,11 +17,11 @@ params ["_unit", ["_force", false]];
if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { if ([_unit] call FUNC(hasMedicalEnabled) || _force) then {
if !(local _unit) exitwith { if !(local _unit) exitWith {
[[_unit, _force], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_unit, _force], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
if ((_unit getvariable[QGVAR(addedToUnitLoop),false] || !alive _unit) && !_force) exitwith{}; if ((_unit getvariable[QGVAR(addedToUnitLoop),false] || !alive _unit) && !_force) exitWith{};
_unit setvariable [QGVAR(addedToUnitLoop), true, true]; _unit setvariable [QGVAR(addedToUnitLoop), true, true];
[{ [{

View File

@ -19,7 +19,7 @@
private ["_moment", "_logVarName", "_log","_newLog", "_logs"]; private ["_moment", "_logVarName", "_log","_newLog", "_logs"];
params ["_unit", "_type", "_message", "_arguments"]; params ["_unit", "_type", "_message", "_arguments"];
if (!local _unit) exitwith { if (!local _unit) exitWith {
[_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };

View File

@ -17,7 +17,7 @@
private ["_log", "_inList", "_amount"]; private ["_log", "_inList", "_amount"];
params ["_unit", "_newItem"]; params ["_unit", "_newItem"];
if (!local _unit) exitwith { if (!local _unit) exitWith {
[_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };
@ -25,7 +25,7 @@ _log = _unit getvariable [QGVAR(triageCard), []];
_inList = false; _inList = false;
_amount = 1; _amount = 1;
{ {
if ((_x select 0) == _newItem) exitwith { if ((_x select 0) == _newItem) exitWith {
private "_info"; private "_info";
_info = _log select _foreachIndex; _info = _log select _foreachIndex;
_info set [1,(_info select 1) + 1]; _info set [1,(_info select 1) + 1];

View File

@ -22,9 +22,9 @@ _accessLevel = _target getvariable [QGVAR(allowSharedEquipmentAccess), -1];
_return = false; _return = false;
if (_accessLevel >= 0) then { if (_accessLevel >= 0) then {
if (_accessLevel == 0) exitwith { _return = true; }; if (_accessLevel == 0) exitWith { _return = true; };
if (_accessLevel == 1) exitwith { _return = (side _target == side _caller); }; if (_accessLevel == 1) exitWith { _return = (side _target == side _caller); };
if (_accessLevel == 2) exitwith { _return = (group _target == group _caller); }; if (_accessLevel == 2) exitWith { _return = (group _target == group _caller); };
}; };
_return; _return;

View File

@ -27,27 +27,27 @@ if !(_target isKindOf "CAManBase") exitWith { false };
_config = (ConfigFile >> "ACE_Medical_Actions" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className); _config = (ConfigFile >> "ACE_Medical_Actions" >> (["Basic", "Advanced"] select (GVAR(level)>=2)) >> _className);
if !(isClass _config) exitwith {false}; if !(isClass _config) exitWith {false};
// Allow self treatment check // Allow self treatment check
if (_caller == _target && {getNumber (_config >> "allowSelfTreatment") == 0}) exitwith {false}; if (_caller == _target && {getNumber (_config >> "allowSelfTreatment") == 0}) exitWith {false};
_medicRequired = if (isNumber (_config >> "requiredMedic")) then { _medicRequired = if (isNumber (_config >> "requiredMedic")) then {
getNumber (_config >> "requiredMedic"); getNumber (_config >> "requiredMedic");
} else { } else {
// Check for required class // Check for required class
if (isText (_config >> "requiredMedic")) exitwith { if (isText (_config >> "requiredMedic")) exitWith {
missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0] missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0]
}; };
0; 0;
}; };
if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith { false }; if !([_caller, _medicRequired] call FUNC(isMedic)) exitWith { false };
_items = getArray (_config >> "items"); _items = getArray (_config >> "items");
if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith { false }; if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitWith { false };
_allowedSelections = getArray (_config >> "allowedSelections"); _allowedSelections = getArray (_config >> "allowedSelections");
if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith { false }; if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitWith { false };
_return = true; _return = true;
if (getText (_config >> "condition") != "") then { if (getText (_config >> "condition") != "") then {
@ -63,27 +63,27 @@ if (getText (_config >> "condition") != "") then {
_return = [_caller, _target, _selectionName, _className] call _condition; _return = [_caller, _target, _selectionName, _className] call _condition;
}; };
}; };
if (!_return) exitwith { false }; if (!_return) exitWith { false };
_patientStateCondition = if (isText(_config >> "patientStateCondition")) then { _patientStateCondition = if (isText(_config >> "patientStateCondition")) then {
missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0]
} else { } else {
getNumber(_config >> "patientStateCondition") getNumber(_config >> "patientStateCondition")
}; };
if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false};
_locations = getArray (_config >> "treatmentLocations"); _locations = getArray (_config >> "treatmentLocations");
if ("All" in _locations) exitwith { true }; if ("All" in _locations) exitWith { true };
private [ "_medFacility", "_medVeh"]; private [ "_medFacility", "_medVeh"];
_medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}; _medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))};
_medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))}; _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))};
{ {
if (_x == "field") exitwith {_return = true;}; if (_x == "field") exitWith {_return = true;};
if (_x == "MedicalFacility" && _medFacility) exitwith {_return = true;}; if (_x == "MedicalFacility" && _medFacility) exitWith {_return = true;};
if (_x == "MedicalVehicle" && _medVeh) exitwith {_return = true;}; if (_x == "MedicalVehicle" && _medVeh) exitWith {_return = true;};
if !(isnil _x) exitwith { if !(isnil _x) exitWith {
private "_val"; private "_val";
_val = missionNamespace getvariable _x; _val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then { if (typeName _val == "SCALAR") then {

View File

@ -17,7 +17,7 @@
private ["_newUnit", "_class", "_group", "_position", "_side", "_name"]; private ["_newUnit", "_class", "_group", "_position", "_side", "_name"];
params ["_oldBody", "_caller"]; params ["_oldBody", "_caller"];
if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies if (alive _oldBody) exitWith {_oldBody}; // we only want to do this for dead bodies
_name = _oldBody getvariable ["ACE_name", "unknown"]; _name = _oldBody getvariable ["ACE_name", "unknown"];
_class = typeof _oldBody; _class = typeof _oldBody;

View File

@ -24,17 +24,17 @@
private ["_config", "_litter", "_createLitter", "_position", "_createdLitter"]; private ["_config", "_litter", "_createLitter", "_position", "_createdLitter"];
params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_previousDamage"]; params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_previousDamage"];
if !(GVAR(allowLitterCreation)) exitwith {}; if !(GVAR(allowLitterCreation)) exitWith {};
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; if (vehicle _caller != _caller || vehicle _target != _target) exitWith {};
_config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className); _config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
}; };
if !(isClass _config) exitwith {false}; if !(isClass _config) exitWith {false};
if !(isArray (_config >> "litter")) exitwith {}; if !(isArray (_config >> "litter")) exitWith {};
_litter = getArray (_config >> "litter"); _litter = getArray (_config >> "litter");
_createLitter = { _createLitter = {
@ -60,7 +60,7 @@ _createLitter = {
_createdLitter = []; _createdLitter = [];
{ {
if (typeName _x == "ARRAY") then { if (typeName _x == "ARRAY") then {
if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {}; if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitWith {};
_x params ["_selection", "_litterCondition", "_litterOptions"]; _x params ["_selection", "_litterCondition", "_litterOptions"];
@ -72,7 +72,7 @@ _createdLitter = [];
_litterCondition = missionNamespace getvariable _litterCondition; _litterCondition = missionNamespace getvariable _litterCondition;
if (typeName _litterCondition != "CODE") then {_litterCondition = {false}}; if (typeName _litterCondition != "CODE") then {_litterCondition = {false}};
}; };
if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {}; if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitWith {};
if (typeName _litterOptions == "ARRAY") then { if (typeName _litterOptions == "ARRAY") then {
// Loop through through the litter options and place the litter // Loop through through the litter options and place the litter

View File

@ -25,9 +25,9 @@
private ["_damageThreshold", "_damageBodyPart", "_chanceFatal"]; private ["_damageThreshold", "_damageBodyPart", "_chanceFatal"];
params ["_unit", "_part", ["_withDamage", 0]]; params ["_unit", "_part", ["_withDamage", 0]];
if (!alive _unit) exitwith {true}; if (!alive _unit) exitWith {true};
if (_part < 0 || _part > 5) exitwith {false}; if (_part < 0 || _part > 5) exitWith {false};
if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true }; if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitWith { true };
// Find the correct Damage threshold for unit. // Find the correct Damage threshold for unit.
_damageThreshold = [1,1,1]; _damageThreshold = [1,1,1];
@ -41,13 +41,13 @@ _damageThreshold params ["_thresholdHead", "_thresholdTorso", "_thresholdLimbs"
_damageBodyPart = ((_unit getvariable [QGVAR(bodyPartStatus),[0, 0, 0, 0, 0, 0]]) select _part) + _withDamage; _damageBodyPart = ((_unit getvariable [QGVAR(bodyPartStatus),[0, 0, 0, 0, 0, 0]]) select _part) + _withDamage;
// Check if damage to body part is higher as damage head // Check if damage to body part is higher as damage head
if (_part == 0) exitwith { if (_part == 0) exitWith {
_chanceFatal = CHANGE_FATAL_HEAD + ((INCREASE_CHANCE_HEAD * (_damageBodyPart - _thresholdHead)) * 10); _chanceFatal = CHANGE_FATAL_HEAD + ((INCREASE_CHANCE_HEAD * (_damageBodyPart - _thresholdHead)) * 10);
(_damageBodyPart >= _thresholdHead && {(_chanceFatal >= random(1))}); (_damageBodyPart >= _thresholdHead && {(_chanceFatal >= random(1))});
}; };
// Check if damage to body part is higher as damage torso // Check if damage to body part is higher as damage torso
if (_part == 1) exitwith { if (_part == 1) exitWith {
_chanceFatal = CHANGE_FATAL_TORSO + ((INCREASE_CHANCE_TORSO * (_damageBodyPart - _thresholdTorso)) * 10); _chanceFatal = CHANGE_FATAL_TORSO + ((INCREASE_CHANCE_TORSO * (_damageBodyPart - _thresholdTorso)) * 10);
(_damageBodyPart >= _thresholdTorso && {(_chanceFatal >= random(1))}); (_damageBodyPart >= _thresholdTorso && {(_chanceFatal >= random(1))});
}; };

View File

@ -36,10 +36,10 @@ if (_show) then {
params ["_args", "_idPFH"]; params ["_args", "_idPFH"];
_args params ["_target", "_selectionN"]; _args params ["_target", "_selectionN"];
if (GVAR(displayPatientInformationTarget) != _target || GVAR(currentSelectedSelectionN) != _selectionN) exitwith { if (GVAR(displayPatientInformationTarget) != _target || GVAR(currentSelectedSelectionN) != _selectionN) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
if (ACE_player distance _target > MAX_DISTANCE) exitwith { if (ACE_player distance _target > MAX_DISTANCE) exitWith {
("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
["displayTextStructured", [ACE_player], [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); ["displayTextStructured", [ACE_player], [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent);
@ -47,7 +47,7 @@ if (_show) then {
disableSerialization; disableSerialization;
_display = uiNamespace getvariable QGVAR(DisplayInformation); _display = uiNamespace getvariable QGVAR(DisplayInformation);
if (isnil "_display") exitwith { if (isnil "_display") exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -27,13 +27,13 @@ if (_show) then {
private ["_target", "_display", "_alphaLevel", "_alphaLevel", "_lbCtrl"]; private ["_target", "_display", "_alphaLevel", "_alphaLevel", "_lbCtrl"];
params ["_args", "_idPFH"]; params ["_args", "_idPFH"];
_args params ["_target"]; _args params ["_target"];
if (GVAR(TriageCardTarget) != _target) exitwith { if (GVAR(TriageCardTarget) != _target) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
disableSerialization; disableSerialization;
_display = uiNamespace getvariable QGVAR(triageCard); _display = uiNamespace getvariable QGVAR(triageCard);
if (isnil "_display") exitwith { if (isnil "_display") exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -18,7 +18,7 @@ params ["_show"];
disableSerialization; disableSerialization;
_display = uiNamespace getvariable QGVAR(triageCard); _display = uiNamespace getvariable QGVAR(triageCard);
if (isnil "_display") exitwith {}; if (isnil "_display") exitWith {};
_pos = [0,0,0,0]; _pos = [0,0,0,0];
if (_show) then { if (_show) then {

View File

@ -17,7 +17,7 @@ params ["_typeOfProjectile"];
if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"};
if (_typeOfProjectile isKindOf "ShotgunBase") exitwith {"bullet"}; if (_typeOfProjectile isKindOf "ShotgunBase") exitWith {"bullet"};
if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"};
if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"};
if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"};

View File

@ -22,7 +22,7 @@ if (isnil QGVAR(unconsciousConditions)) then {
_return = false; _return = false;
{ {
if (typeName _x == typeName {} && {([_unit] call _x)}) exitwith { if (typeName _x == typeName {} && {([_unit] call _x)}) exitWith {
_return = true; _return = true;
}; };
} foreach GVAR(unconsciousConditions); } foreach GVAR(unconsciousConditions);

View File

@ -56,7 +56,7 @@ _injuryType = _injury select 1;
_exist = false; _exist = false;
_bandagedInjury = []; _bandagedInjury = [];
{ {
if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitwith { if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitWith {
_exist = true; _exist = true;
_existingInjury = _x; _existingInjury = _x;
_existingInjury set [3, (_existingInjury select 3) + _impact]; _existingInjury set [3, (_existingInjury select 3) + _impact];
@ -83,7 +83,7 @@ if (random(1) <= _reopeningChance) then {
//if (alive _target) then { //if (alive _target) then {
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];
if ((count _openWounds)-1 < _injuryIndex) exitwith {}; if ((count _openWounds)-1 < _injuryIndex) exitWith {};
_selectedInjury = _openWounds select _injuryIndex; _selectedInjury = _openWounds select _injuryIndex;
if (_selectedInjury select 1 == _injury select 1 && (_selectedInjury select 2) == (_injury select 2)) then { // matching the IDs if (_selectedInjury select 1 == _injury select 1 && (_selectedInjury select 2) == (_injury select 2)) then { // matching the IDs
_selectedInjury set [3, (_selectedInjury select 3) + _impact]; _selectedInjury set [3, (_selectedInjury select 3) + _impact];
@ -93,7 +93,7 @@ if (random(1) <= _reopeningChance) then {
_exist = false; _exist = false;
_injuryId = _injury select 1; _injuryId = _injury select 1;
{ {
if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitwith { if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitWith {
_exist = true; _exist = true;
_existingInjury = _x; _existingInjury = _x;
_existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0];

View File

@ -57,7 +57,7 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then {
} forEach GVAR(allCreatedLitter); } forEach GVAR(allCreatedLitter);
GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull];
if ( (count GVAR(allCreatedLitter)) == 0) exitwith { if ( (count GVAR(allCreatedLitter)) == 0) exitWith {
[(_this select 1)] call CBA_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
GVAR(litterPFHRunning) = false; GVAR(litterPFHRunning) = false;
}; };

View File

@ -82,7 +82,7 @@ if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isN
}; };
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then { if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then {
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitWith {
_damageReturn = 0.9; _damageReturn = 0.9;
}; };
if ([_unit] call FUNC(setDead)) then { if ([_unit] call FUNC(setDead)) then {
@ -109,7 +109,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW
}; };
if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith { if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith {
if (_unit getvariable ["ACE_isUnconscious", false]) exitwith { if (_unit getvariable ["ACE_isUnconscious", false]) exitWith {
[_unit] call FUNC(setDead); [_unit] call FUNC(setDead);
0.89; 0.89;
}; };

View File

@ -23,7 +23,7 @@ private ["_typeOfProjectile", "_part", "_damageBodyParts", "_hitPoints"];
params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_hitPointNumber", "_newDamage"]; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_hitPointNumber", "_newDamage"];
_part = [_selectionName] call FUNC(selectionNameToNumber); _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitwith {}; if (_part < 0) exitWith {};
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
// Sorting out the damage // Sorting out the damage

View File

@ -15,7 +15,7 @@
params ["_unit"]; params ["_unit"];
if (!local _unit) exitwith {}; if (!local _unit) exitWith {};
private "_bodyStatus"; private "_bodyStatus";

View File

@ -21,7 +21,7 @@ private "_bodyPartn";
params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"];
_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber);
if (_bodyPartn > 1) exitwith {}; if (_bodyPartn > 1) exitWith {};
if (_amountOfDamage > 0.5) then { if (_amountOfDamage > 0.5) then {
if (random(1) >= 0.8) then { if (random(1) >= 0.8) then {

View File

@ -26,7 +26,7 @@ TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_c
_x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"];
if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then {
_part = [_selectionName] call FUNC(selectionNameToNumber); _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitwith {}; if (_part < 0) exitWith {};
private ["_newDamage", "_pain"]; private ["_newDamage", "_pain"];
_newDamage = (_cache_damages select _foreachIndex); _newDamage = (_cache_damages select _foreachIndex);

View File

@ -106,7 +106,7 @@ if (_selectionName != "") then {
private ["_index","_otherDamage"]; private ["_index","_otherDamage"];
_index = _cache_projectiles find _projectile; _index = _cache_projectiles find _projectile;
// Check if the current projectile has already been handled once // Check if the current projectile has already been handled once
if (_index >= 0 && {_projectile != "falling"}) exitwith { if (_index >= 0 && {_projectile != "falling"}) exitWith {
_cache_damages = _unit getVariable QGVAR(cachedDamages); _cache_damages = _unit getVariable QGVAR(cachedDamages);
// Find the previous damage this projectile has done // Find the previous damage this projectile has done
_otherDamage = (_cache_damages select _index); _otherDamage = (_cache_damages select _index);

View File

@ -37,7 +37,7 @@ _foundIndex = -1;
_bodyPartNToAdd = _x select 2; _bodyPartNToAdd = _x select 2;
{ {
// Check if we have an id of the given class on the given bodypart already // Check if we have an id of the given class on the given bodypart already
if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitWith {
_foundIndex = _foreachIndex; _foundIndex = _foreachIndex;
}; };
} foreach _openWounds; } foreach _openWounds;

View File

@ -23,7 +23,7 @@ TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD Called",_unit, _selectionName, _damag
// Convert the selectionName to a number and ensure it is a valid selection. // Convert the selectionName to a number and ensure it is a valid selection.
_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber);
if (_bodyPartn < 0) exitwith {}; if (_bodyPartn < 0) exitWith {};
// Get the injury type information. Format: [typeDamage thresholds, selectionSpecific, woundTypes] // Get the injury type information. Format: [typeDamage thresholds, selectionSpecific, woundTypes]
_injuryTypeInfo = missionNamespace getvariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; _injuryTypeInfo = missionNamespace getvariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]];
@ -70,7 +70,7 @@ _allPossibleInjuries = [];
} foreach _allInjuriesForDamageType; } foreach _allInjuriesForDamageType;
// No possible wounds available for this damage type or damage amount. // No possible wounds available for this damage type or damage amount.
if (_highestPossibleSpot < 0) exitwith {}; if (_highestPossibleSpot < 0) exitWith {};
// Administration for open wounds and ids // Administration for open wounds and ids
_openWounds = _unit getvariable[QGVAR(openWounds), []]; _openWounds = _unit getvariable[QGVAR(openWounds), []];
@ -79,7 +79,7 @@ _woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1];
_painToAdd = 0; _painToAdd = 0;
_woundsCreated = []; _woundsCreated = [];
{ {
if (_x select 0 <= _damage) exitwith { if (_x select 0 <= _damage) exitWith {
for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do { 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] // Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage]
@ -92,7 +92,7 @@ _woundsCreated = [];
if ((_injuryTypeInfo select 1)) then { if ((_injuryTypeInfo select 1)) then {
{ {
// Check if we have an id of the given class on the given bodypart already // Check if we have an id of the given class on the given bodypart already
if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitWith {
_foundIndex = _foreachIndex; _foundIndex = _foreachIndex;
}; };
} foreach _openWounds; } foreach _openWounds;

View File

@ -15,7 +15,7 @@
private "_openWounds"; private "_openWounds";
params ["_unit"]; params ["_unit"];
if (!local _unit) exitwith {}; if (!local _unit) exitWith {};
_unit setvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), 0];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {

View File

@ -98,7 +98,7 @@ if (GVAR(level) == 1) then {
// handle advanced medical, with vitals // handle advanced medical, with vitals
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {
TRACE_6("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_bloodVolume, _unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); TRACE_6("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_bloodVolume, _unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit);
if (_bloodVolume < 30) exitwith { if (_bloodVolume < 30) exitWith {
[_unit] call FUNC(setDead); [_unit] call FUNC(setDead);
}; };

View File

@ -21,11 +21,11 @@ params ["_medic", "_patient", "_item"];
if (isnil QGVAR(setting_allowSharedEquipment)) then { if (isnil QGVAR(setting_allowSharedEquipment)) then {
GVAR(setting_allowSharedEquipment) = true; GVAR(setting_allowSharedEquipment) = true;
}; };
if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith {
true true
}; };
if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { if ([_medic, _item] call EFUNC(common,hasItem)) exitWith {
true true
}; };
@ -33,7 +33,7 @@ _return = false;
if ((vehicle _medic != _medic) && {[vehicle _medic] call FUNC(isMedicalVehicle)}) then { if ((vehicle _medic != _medic) && {[vehicle _medic] call FUNC(isMedicalVehicle)}) then {
_crew = crew vehicle _medic; _crew = crew vehicle _medic;
{ {
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith {
_return = true; _return = true;
}; };
} foreach _crew; } foreach _crew;

View File

@ -21,10 +21,10 @@ params ["_medic", "_patient", "_items"];
_return = true; _return = true;
{ {
// //
if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith { if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitWith {
_return = false; _return = false;
}; };
if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith { if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitWith {
_return = false; _return = false;
}; };
}foreach _items; }foreach _items;

View File

@ -20,7 +20,7 @@ private "_medicalEnabled";
params ["_unit"]; params ["_unit"];
_medicalEnabled = _unit getvariable QGVAR(enableMedical); _medicalEnabled = _unit getvariable QGVAR(enableMedical);
if (isnil "_medicalEnabled") exitwith { if (isnil "_medicalEnabled") exitWith {
(((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1) (((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1)
}; };

View File

@ -39,14 +39,14 @@ _medicalFacility =
_objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]); _objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]);
{ {
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitWith {
_isInBuilding = true; _isInBuilding = true;
}; };
} foreach _objects; } foreach _objects;
if (!_isInBuilding) then { if (!_isInBuilding) then {
_objects = position _unit nearObjects 7.5; _objects = position _unit nearObjects 7.5;
{ {
if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitWith {
_isInBuilding = true; _isInBuilding = true;
}; };
} foreach _objects; } foreach _objects;

View File

@ -16,7 +16,7 @@
private ["_openWounds", "_openWounds"]; private ["_openWounds", "_openWounds"];
params ["_unit"]; params ["_unit"];
if (GVAR(level) <= 1) exitwith { if (GVAR(level) <= 1) exitWith {
([_unit] call FUNC(getBloodloss)) == 0; ([_unit] call FUNC(getBloodloss)) == 0;
}; };

View File

@ -19,7 +19,7 @@
params ["_target", "_player", "_selectionN", "_actionData"]; params ["_target", "_player", "_selectionN", "_actionData"];
if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith { if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitWith {
private ["_pointDamage"]; private ["_pointDamage"];
_pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN;
@ -35,7 +35,7 @@ private ["_openWounds", "_amountOf"];
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];
{ {
_x params ["", "", "_selectionX", "_amountOf", "_x4"]; _x params ["", "", "_selectionX", "_amountOf", "_x4"];
if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitwith { if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitWith {
_actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))];
}; };
} foreach _openWounds; } foreach _openWounds;

View File

@ -25,7 +25,7 @@ _foundEntry = false;
_allUsedMedication = _target getvariable [QGVAR(allUsedMedication), []]; _allUsedMedication = _target getvariable [QGVAR(allUsedMedication), []];
{ {
_x params ["_variableX", "_allMedsFromClassname"]; _x params ["_variableX", "_allMedsFromClassname"];
if (_variableX== _variable) exitwith { if (_variableX== _variable) exitWith {
if !(_className in _allMedsFromClassname) then { if !(_className in _allMedsFromClassname) then {
_allMedsFromClassname pushback _className; _allMedsFromClassname pushback _className;
_x set [1, _allMedsFromClassname]; _x set [1, _allMedsFromClassname];

View File

@ -23,7 +23,7 @@ if (!local _unit) then {
_exists = false; _exists = false;
{ {
if (_x select 0 == _injuryID) exitwith { if (_x select 0 == _injuryID) exitWith {
_exists = true; _exists = true;
_openWounds set [_foreachIndex, _injury]; _openWounds set [_foreachIndex, _injury];
}; };

View File

@ -43,7 +43,7 @@ GVAR(fractureClassNames) = [];
// function for parsing a sublcass of an injury // function for parsing a sublcass of an injury
_parseForSubClassWounds = { _parseForSubClassWounds = {
_subClass = _this select 0; _subClass = _this select 0;
if (isClass (_entry >> _subClass)) exitwith { if (isClass (_entry >> _subClass)) exitWith {
_subClassConfig = (_entry >> _subClass); _subClassConfig = (_entry >> _subClass);
_subClasstype = _classType + (configName _subClassConfig); _subClasstype = _classType + (configName _subClassConfig);
_subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections }; _subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections };
@ -82,7 +82,7 @@ if (isClass _woundsConfig) then {
_classDisplayName = if (isText(_entry >> "name")) then { getText(_entry >> "name");} else {_classType}; _classDisplayName = if (isText(_entry >> "name")) then { getText(_entry >> "name");} else {_classType};
// TODO instead of hardcoding minor, medium and large just go through all sub classes recursively until none are found // TODO instead of hardcoding minor, medium and large just go through all sub classes recursively until none are found
if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitwith {}; // continue to the next one if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitWith {}; // continue to the next one
// There were no subclasses, so we will add this one instead. // There were no subclasses, so we will add this one instead.
if (count _selections > 0 && count _causes > 0) then { if (count _selections > 0 && count _causes > 0) then {

View File

@ -18,14 +18,14 @@
private ["_unit","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound", "_pain"]; private ["_unit","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound", "_pain"];
params ["_unit", "_pain"]; params ["_unit", "_pain"];
if (!local _unit || !GVAR(enableScreams)) exitwith{}; if (!local _unit || !GVAR(enableScreams)) exitWith{};
// Lock if the unit is already playing a sound. // Lock if the unit is already playing a sound.
if ((_unit getvariable [QGVAR(playingInjuredSound),false])) exitwith {}; if ((_unit getvariable [QGVAR(playingInjuredSound),false])) exitWith {};
_unit setvariable [QGVAR(playingInjuredSound),true]; _unit setvariable [QGVAR(playingInjuredSound),true];
// Play the sound if there is any damage present. // Play the sound if there is any damage present.
if (_pain > 0 && {[_unit] call EFUNC(common,isAwake)}) exitwith { if (_pain > 0 && {[_unit] call EFUNC(common,isAwake)}) exitWith {
// Classnames of the available sounds. // Classnames of the available sounds.
_availableSounds_A = [ _availableSounds_A = [
"WoundedGuyA_01", "WoundedGuyA_01",

View File

@ -16,7 +16,7 @@
params [ "_target", "_caller"]; params [ "_target", "_caller"];
if (local _target || GVAR(level) < 2) exitwith {}; // if the target is local, we already got the most update to date information if (local _target || GVAR(level) < 2) exitWith {}; // if the target is local, we already got the most update to date information
if (_target getvariable [QGVAR(isWoundSynced), false]) exitwith {}; if (_target getvariable [QGVAR(isWoundSynced), false]) exitWith {};
_target setvariable [QGVAR(isWoundSynced), true]; _target setvariable [QGVAR(isWoundSynced), true];
["medical_woundUpdateRequest", [_target], [_target, _caller]] call EFUNC(common,targetEvent); ["medical_woundUpdateRequest", [_target], [_target, _caller]] call EFUNC(common,targetEvent);

View File

@ -17,7 +17,7 @@
private "_timeInCardiacArrest"; private "_timeInCardiacArrest";
params ["_unit"]; params ["_unit"];
if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitwith {}; if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitWith {};
_unit setvariable [QGVAR(inCardiacArrest), true,true]; _unit setvariable [QGVAR(inCardiacArrest), true,true];
_unit setvariable [QGVAR(heartRate), 0]; _unit setvariable [QGVAR(heartRate), 0];
@ -32,11 +32,11 @@ _timeInCardiacArrest = 120 + round(random(600));
_args params ["_unit", "_startTime", "_timeInCardiacArrest"]; _args params ["_unit", "_startTime", "_timeInCardiacArrest"];
_heartRate = _unit getvariable [QGVAR(heartRate), 80]; _heartRate = _unit getvariable [QGVAR(heartRate), 80];
if (_heartRate > 0 || !alive _unit) exitwith { if (_heartRate > 0 || !alive _unit) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inCardiacArrest), nil,true]; _unit setvariable [QGVAR(inCardiacArrest), nil,true];
}; };
if (ACE_time - _startTime >= _timeInCardiacArrest) exitwith { if (ACE_time - _startTime >= _timeInCardiacArrest) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inCardiacArrest), nil,true]; _unit setvariable [QGVAR(inCardiacArrest), nil,true];
[_unit] call FUNC(setDead); [_unit] call FUNC(setDead);

View File

@ -16,15 +16,15 @@
private ["_unit", "_force", "_reviveVal", "_lifesLeft"]; private ["_unit", "_force", "_reviveVal", "_lifesLeft"];
params ["_unit", ["_force", false]]; params ["_unit", ["_force", false]];
if (!alive _unit) exitwith{true}; if (!alive _unit) exitWith{true};
if (!local _unit) exitwith { if (!local _unit) exitWith {
[[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
false; false;
}; };
_reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; _reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)];
if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith { if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitWith {
if (_unit getvariable [QGVAR(inReviveState), false]) exitwith { if (_unit getvariable [QGVAR(inReviveState), false]) exitWith {
if (GVAR(amountOfReviveLives) > 0) then { if (GVAR(amountOfReviveLives) > 0) then {
_lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)];
if (_lifesLeft == 0) then { if (_lifesLeft == 0) then {
@ -45,14 +45,14 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal ==
_args params ["_unit"]; _args params ["_unit"];
_startTime = _unit getvariable [QGVAR(reviveStartTime), 0]; _startTime = _unit getvariable [QGVAR(reviveStartTime), 0];
if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith { if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setvariable [QGVAR(inReviveState), nil, true]; _unit setvariable [QGVAR(inReviveState), nil, true];
_unit setvariable [QGVAR(reviveStartTime), nil]; _unit setvariable [QGVAR(reviveStartTime), nil];
[_unit, true] call FUNC(setDead); [_unit, true] call FUNC(setDead);
}; };
if !(_unit getvariable [QGVAR(inReviveState), false]) exitwith { if !(_unit getvariable [QGVAR(inReviveState), false]) exitWith {
// revived without dieing, so in case we have lifes, remove one. // revived without dieing, so in case we have lifes, remove one.
if (GVAR(amountOfReviveLives) > 0) then { if (GVAR(amountOfReviveLives) > 0) then {
_lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)];

View File

@ -32,13 +32,13 @@ params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force",
// No change, fuck off. (why is there no xor?) // No change, fuck off. (why is there no xor?)
if (_set isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {}; if (_set isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {};
if !(_set) exitwith { if !(_set) exitWith {
_unit setvariable ["ACE_isUnconscious", false, true]; _unit setvariable ["ACE_isUnconscious", false, true];
}; };
if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{}; if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitWith{};
if (!local _unit) exitwith { if (!local _unit) exitWith {
[[_unit, _set, _minWaitingTime, _force], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_unit, _set, _minWaitingTime, _force], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };

View File

@ -39,10 +39,10 @@ if (_selection in HEAD_SELECTIONS) exitWith {"head"};
if (_selection in TORSO_SELECTIONS) exitWith {"body"}; if (_selection in TORSO_SELECTIONS) exitWith {"body"};
// Not necessary unless we get more hitpoints variants in an next arma update // Not necessary unless we get more hitpoints variants in an next arma update
/*if (_selection in L_ARM_SELECTIONS) exitwith {"hand_l"}; /*if (_selection in L_ARM_SELECTIONS) exitWith {"hand_l"};
if (_selection in R_ARM_SELECTIONS) exitwith {"hand_r"}; if (_selection in R_ARM_SELECTIONS) exitWith {"hand_r"};
if (_selection in L_LEG_SELECTIONS) exitwith {"leg_l"}; if (_selection in L_LEG_SELECTIONS) exitWith {"leg_l"};
if (_selection in R_LEG_SELECTIONS) exitwith {"leg_r"};*/ if (_selection in R_LEG_SELECTIONS) exitWith {"leg_r"};*/
//Backup method to detect weird selections/hitpoints //Backup method to detect weird selections/hitpoints
if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith { if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith {

View File

@ -20,7 +20,7 @@ private ["_config", "_medicRequired", "_items", "_locations", "_return", "_callb
params ["_caller", "_target", "_selectionName", "_className"]; params ["_caller", "_target", "_selectionName", "_className"];
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine // If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitWith {
[{ [{
_this call FUNC(treatment); _this call FUNC(treatment);
}, _this] call EFUNC(common,execNextFrame); }, _this] call EFUNC(common,execNextFrame);
@ -32,29 +32,29 @@ _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className);
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {
_config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className); _config = (configFile >> "ACE_Medical_Actions" >> "Advanced" >> _className);
}; };
if !(isClass _config) exitwith {false}; if !(isClass _config) exitWith {false};
// Allow self treatment check // Allow self treatment check
if (_caller == _target && {getNumber (_config >> "allowSelfTreatment") == 0}) exitwith {false}; if (_caller == _target && {getNumber (_config >> "allowSelfTreatment") == 0}) exitWith {false};
_medicRequired = if (isNumber (_config >> "requiredMedic")) then { _medicRequired = if (isNumber (_config >> "requiredMedic")) then {
getNumber (_config >> "requiredMedic"); getNumber (_config >> "requiredMedic");
} else { } else {
// Check for required class // Check for required class
if (isText (_config >> "requiredMedic")) exitwith { if (isText (_config >> "requiredMedic")) exitWith {
missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0]; missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0];
}; };
0; 0;
}; };
if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; if !([_caller, _medicRequired] call FUNC(isMedic)) exitWith {false};
_allowedSelections = getArray (_config >> "allowedSelections"); _allowedSelections = getArray (_config >> "allowedSelections");
if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false}; if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitWith {false};
// Check item // Check item
_items = getArray (_config >> "items"); _items = getArray (_config >> "items");
if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitWith {false};
_return = true; _return = true;
if (isText (_config >> "Condition")) then { if (isText (_config >> "Condition")) then {
@ -72,14 +72,14 @@ if (isText (_config >> "Condition")) then {
}; };
}; };
}; };
if (!_return) exitwith {false}; if (!_return) exitWith {false};
_patientStateCondition = if (isText(_config >> "patientStateCondition")) then { _patientStateCondition = if (isText(_config >> "patientStateCondition")) then {
missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0]
} else { } else {
getNumber(_config >> "patientStateCondition") getNumber(_config >> "patientStateCondition")
}; };
if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false};
// Check allowed locations // Check allowed locations
_locations = getArray (_config >> "treatmentLocations"); _locations = getArray (_config >> "treatmentLocations");
@ -92,10 +92,10 @@ if ("All" in _locations) then {
_medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))}; _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))};
{ {
if (_x == "field") exitwith {_return = true;}; if (_x == "field") exitWith {_return = true;};
if (_x == "MedicalFacility" && _medFacility) exitwith {_return = true;}; if (_x == "MedicalFacility" && _medFacility) exitWith {_return = true;};
if (_x == "MedicalVehicle" && _medVeh) exitwith {_return = true;}; if (_x == "MedicalVehicle" && _medVeh) exitWith {_return = true;};
if !(isnil _x) exitwith { if !(isnil _x) exitWith {
private "_val"; private "_val";
_val = missionNamespace getvariable _x; _val = missionNamespace getvariable _x;
if (typeName _val == "SCALAR") then { if (typeName _val == "SCALAR") then {
@ -111,14 +111,14 @@ if ("All" in _locations) then {
} foreach _locations; } foreach _locations;
}; };
if !(_return) exitwith {false}; if !(_return) exitWith {false};
_usersOfItems = []; _usersOfItems = [];
_consumeItems = if (isNumber (_config >> "itemConsumed")) then { _consumeItems = if (isNumber (_config >> "itemConsumed")) then {
getNumber (_config >> "itemConsumed"); getNumber (_config >> "itemConsumed");
} else { } else {
// Check for required class // Check for required class
if (isText (_config >> "itemConsumed")) exitwith { if (isText (_config >> "itemConsumed")) exitWith {
missionNamespace getvariable [(getText (_config >> "itemConsumed")), 0]; missionNamespace getvariable [(getText (_config >> "itemConsumed")), 0];
}; };
0; 0;
@ -198,14 +198,14 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then {
_treatmentTime = if (isNumber (_config >> "treatmentTime")) then { _treatmentTime = if (isNumber (_config >> "treatmentTime")) then {
getNumber (_config >> "treatmentTime"); getNumber (_config >> "treatmentTime");
} else { } else {
if (isText (_config >> "treatmentTime")) exitwith { if (isText (_config >> "treatmentTime")) exitWith {
_treatmentTimeConfig = getText(_config >> "treatmentTime"); _treatmentTimeConfig = getText(_config >> "treatmentTime");
if (isnil _treatmentTimeConfig) then { if (isnil _treatmentTimeConfig) then {
_treatmentTimeConfig = compile _treatmentTimeConfig; _treatmentTimeConfig = compile _treatmentTimeConfig;
} else { } else {
_treatmentTimeConfig = missionNamespace getvariable _treatmentTimeConfig; _treatmentTimeConfig = missionNamespace getvariable _treatmentTimeConfig;
}; };
if (typeName _treatmentTimeConfig == "SCALAR") exitwith { if (typeName _treatmentTimeConfig == "SCALAR") exitWith {
_treatmentTimeConfig; _treatmentTimeConfig;
}; };
[_caller, _target, _selectionName, _className] call _treatmentTimeConfig; [_caller, _target, _selectionName, _className] call _treatmentTimeConfig;

View File

@ -22,7 +22,7 @@ params ["_caller", "_target", "_selectionName", "_className", "_items", "", ["_s
[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); [_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message [_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
if !([_target] call FUNC(hasMedicalEnabled)) exitwith { if !([_target] call FUNC(hasMedicalEnabled)) exitWith {
_this call FUNC(treatmentBasic_bandage); _this call FUNC(treatmentBasic_bandage);
}; };

View File

@ -20,11 +20,11 @@ params ["_target", "_bandage", "_selectionName", ["_specificClass", -1]];
// Ensure it is a valid bodypart // Ensure it is a valid bodypart
_part = [_selectionName] call FUNC(selectionNameToNumber); _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitwith {false}; if (_part < 0) exitWith {false};
// Get the open wounds for this unit // Get the open wounds for this unit
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];
if (count _openWounds == 0) exitwith {false}; // nothing to do here! if (count _openWounds == 0) exitWith {false}; // nothing to do here!
// Get the default effectiveness for the used bandage // Get the default effectiveness for the used bandage
_config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging"); _config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging");
@ -58,7 +58,7 @@ _exit = false;
}; };
TRACE_2("Wound classes: ", _specificClass, _classID); TRACE_2("Wound classes: ", _specificClass, _classID);
if (_specificClass == _classID) exitwith { if (_specificClass == _classID) exitWith {
_effectivenessFound = _woundEffectivenss; _effectivenessFound = _woundEffectivenss;
_mostEffectiveSpot = _foreachIndex; _mostEffectiveSpot = _foreachIndex;
_mostEffectiveInjury = _x; _mostEffectiveInjury = _x;
@ -72,10 +72,10 @@ _exit = false;
_mostEffectiveInjury = _x; _mostEffectiveInjury = _x;
}; };
}; };
if (_exit) exitwith {}; if (_exit) exitWith {};
} foreach _openWounds; } foreach _openWounds;
if (_effectivenessFound == -1) exitwith {}; // Seems everything is patched up on this body part already.. if (_effectivenessFound == -1) exitWith {}; // Seems everything is patched up on this body part already..
// TODO refactor this part // TODO refactor this part

View File

@ -13,7 +13,7 @@
private "_allUsedMedication"; private "_allUsedMedication";
params ["_caller", "_target"]; params ["_caller", "_target"];
if (alive _target) exitwith { if (alive _target) exitWith {
_target setVariable [QGVAR(pain), 0, true]; _target setVariable [QGVAR(pain), 0, true];
_target setVariable [QGVAR(morphine), 0, true]; _target setVariable [QGVAR(morphine), 0, true];

View File

@ -22,7 +22,7 @@ _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
// Ensure it is a valid bodypart // Ensure it is a valid bodypart
_part = [_selectionName] call FUNC(selectionNameToNumber); _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitwith {false}; if (_part < 0) exitWith {false};
if ((_damageBodyParts select _part) > 0) then { if ((_damageBodyParts select _part) > 0) then {
_damageOnPart = (_damageBodyParts select _part); _damageOnPart = (_damageBodyParts select _part);

View File

@ -19,7 +19,7 @@
private "_removeItem"; private "_removeItem";
params ["_caller", "_target", "_selectionName", "_className", "_items"]; params ["_caller", "_target", "_selectionName", "_className", "_items"];
if (count _items == 0) exitwith {false}; if (count _items == 0) exitWith {false};
_removeItem = _items select 0; _removeItem = _items select 0;
[[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -19,7 +19,7 @@ private ["_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"];
params ["_target", "_treatmentClassname"]; params ["_target", "_treatmentClassname"];
_bloodVolume = _target getvariable [QGVAR(bloodVolume), 100]; _bloodVolume = _target getvariable [QGVAR(bloodVolume), 100];
if (_bloodVolume >= 100) exitwith {}; if (_bloodVolume >= 100) exitWith {};
// Find the proper attributes for the used IV // Find the proper attributes for the used IV
_config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV");

View File

@ -24,16 +24,16 @@ _selectionName = _this select 2;
_className = _this select 3; _className = _this select 3;
_items = _this select 4; _items = _this select 4;
if (count _items == 0) exitwith {false}; if (count _items == 0) exitWith {false};
_part = [_selectionName] call FUNC(selectionNameToNumber); _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part == 0 || _part == 1) exitwith { if (_part == 0 || _part == 1) exitWith {
// ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent); // ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent);
false; false;
}; };
_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
if ((_tourniquets select _part) > 0) exitwith { if ((_tourniquets select _part) > 0) exitWith {
_output = "There is already a tourniquet on this body part!"; // TODO localization _output = "There is already a tourniquet on this body part!"; // TODO localization
["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent);
false; false;

View File

@ -30,12 +30,12 @@ _target setvariable [QGVAR(tourniquets), _tourniquets, true];
params ["_args", "_idPFH"]; params ["_args", "_idPFH"];
_args params ["_target", "_applyingTo", "_part", "_time"]; _args params ["_target", "_applyingTo", "_part", "_time"];
if (!alive _target) exitwith { if (!alive _target) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
if !((_tourniquets select _part) == _applyingTo) exitwith { if !((_tourniquets select _part) == _applyingTo) exitWith {
// Tourniquet has been removed // Tourniquet has been removed
[_idPFH] call CBA_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -25,7 +25,7 @@ _args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_has
TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _originalPos, _startingTime, _minWaitingTime, _hasMovedOut, _parachuteCheck); TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _originalPos, _startingTime, _minWaitingTime, _hasMovedOut, _parachuteCheck);
if (!alive _unit) exitwith { if (!alive _unit) exitWith {
if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then {
TRACE_1("Removing fake weapon [on death]",_unit); TRACE_1("Removing fake weapon [on death]",_unit);
_unit removeWeapon "ACE_FakePrimaryWeapon"; _unit removeWeapon "ACE_FakePrimaryWeapon";
@ -47,7 +47,7 @@ if (!alive _unit) exitwith {
}; };
// In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation
if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { if !(_unit getvariable ["ACE_isUnconscious",false]) exitWith {
TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getvariable QGVAR(unconsciousArguments),animationState _unit); TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getvariable QGVAR(unconsciousArguments),animationState _unit);
// TODO, handle this with carry instead, so we can remove the PFH here. // TODO, handle this with carry instead, so we can remove the PFH here.
// Wait until the unit isn't being carried anymore, so we won't end up with wierd animations // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations
@ -128,7 +128,7 @@ if (_parachuteCheck) then {
}; };
}; };
if (!local _unit) exitwith { if (!local _unit) exitWith {
TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getvariable QGVAR(unconsciousArguments)); TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getvariable QGVAR(unconsciousArguments));
_args set [3, _minWaitingTime - (ACE_time - _startingTime)]; _args set [3, _minWaitingTime - (ACE_time - _startingTime)];
_unit setvariable [QGVAR(unconsciousArguments), _args, true]; _unit setvariable [QGVAR(unconsciousArguments), _args, true];
@ -136,7 +136,7 @@ if (!local _unit) exitwith {
}; };
// Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs
if ((ACE_time - _startingTime) >= _minWaitingTime) exitwith { if ((ACE_time - _startingTime) >= _minWaitingTime) exitWith {
TRACE_2("ACE_DEBUG_Unconscious_Temp knock outs",_unit, [_unit] call FUNC(getUnconsciousCondition)); TRACE_2("ACE_DEBUG_Unconscious_Temp knock outs",_unit, [_unit] call FUNC(getUnconsciousCondition));
if (!([_unit] call FUNC(getUnconsciousCondition))) then { if (!([_unit] call FUNC(getUnconsciousCondition))) then {
_unit setvariable ["ACE_isUnconscious", false, true]; _unit setvariable ["ACE_isUnconscious", false, true];

View File

@ -23,12 +23,12 @@ if (isnil QGVAR(setting_allowSharedEquipment)) then {
GVAR(setting_allowSharedEquipment) = true; GVAR(setting_allowSharedEquipment) = true;
}; };
if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith {
[[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[true, _patient]; [true, _patient];
}; };
if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { if ([_medic, _item] call EFUNC(common,hasItem)) exitWith {
[[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[true, _medic]; [true, _medic];
}; };
@ -37,7 +37,7 @@ _return = [false, objNull];
if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) then { if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) then {
_crew = crew vehicle _medic; _crew = crew vehicle _medic;
{ {
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith {
_return = [true, _x]; _return = [true, _x];
[[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
}; };

View File

@ -24,14 +24,14 @@ _itemsUsedBy = [];
if (typeName _x == "ARRAY") then { if (typeName _x == "ARRAY") then {
{ {
_itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
} foreach _x; } foreach _x;
}; };
// handle required item // handle required item
if (typeName _x == "STRING") then { if (typeName _x == "STRING") then {
_itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
}; };
} foreach _items; } foreach _items;

View File

@ -1,6 +1,6 @@
#include "script_component.hpp" #include "script_component.hpp"
if (!hasInterface) exitwith {}; if (!hasInterface) exitWith {};
GVAR(MenuPFHID) = -1; GVAR(MenuPFHID) = -1;
GVAR(lastOpenedOn) = -1; GVAR(lastOpenedOn) = -1;
@ -24,7 +24,7 @@ GVAR(pendingReopen) = false;
// Conditions: canInteract // Conditions: canInteract
if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false}; if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false};
// Statement // Statement
[_target] call FUNC(openMenu); [_target] call FUNC(openMenu);

View File

@ -21,7 +21,7 @@ params ["_player", "_target", "_name"];
private ["_actions", "_collectedActions", "_bodyPart"]; private ["_actions", "_collectedActions", "_bodyPart"];
if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]}; if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {[]};
_actions = if (EGVAR(medical,level) == 2) then { _actions = if (EGVAR(medical,level) == 2) then {
GVAR(actionsAdvanced); GVAR(actionsAdvanced);

View File

@ -19,7 +19,7 @@
#define END_IDC 27 #define END_IDC 27
#define AMOUNT_OF_ENTRIES (count _entries) #define AMOUNT_OF_ENTRIES (count _entries)
if (!hasInterface) exitwith{}; if (!hasInterface) exitWith{};
private ["_entries", "_display", "_newTarget", "_ctrl", "_code"]; private ["_entries", "_display", "_newTarget", "_ctrl", "_code"];
@ -28,9 +28,9 @@ params ["_name"];
disableSerialization; disableSerialization;
_display = uiNamespace getVariable QGVAR(medicalMenu); _display = uiNamespace getVariable QGVAR(medicalMenu);
if (isNil "_display") exitwith {}; // no valid dialog present if (isNil "_display") exitWith {}; // no valid dialog present
if (_name isEqualTo "toggle") exitwith { if (_name isEqualTo "toggle") exitWith {
_newTarget = ACE_player; _newTarget = ACE_player;
//If we are on the player, and only if our old target is still valid, switch to it: //If we are on the player, and only if our old target is still valid, switch to it:
if ((GVAR(INTERACTION_TARGET) == ACE_player) && if ((GVAR(INTERACTION_TARGET) == ACE_player) &&
@ -61,7 +61,7 @@ GVAR(LatestDisplayOptionMenu) = _name;
// The triage card has no options available // The triage card has no options available
lbClear 212; lbClear 212;
if (_name isEqualTo "triage") exitwith { if (_name isEqualTo "triage") exitWith {
ctrlEnable [212, true]; ctrlEnable [212, true];
private ["_log", "_triageCardTexts", "_message"]; private ["_log", "_triageCardTexts", "_message"];
@ -81,7 +81,7 @@ if (_name isEqualTo "triage") exitwith {
nil; nil;
} count _log; } count _log;
if (count _triageCardTexts == 0) exitwith { if (count _triageCardTexts == 0) exitWith {
lbAdd [212,(localize ELSTRING(medical,TriageCard_NoEntry))]; lbAdd [212,(localize ELSTRING(medical,TriageCard_NoEntry))];
}; };
{ {
@ -96,7 +96,7 @@ _entries = [ACE_player, GVAR(INTERACTION_TARGET), _name] call FUNC(getTreatmentO
{ {
//player sidechat format["TRIGGERED: %1",_x]; //player sidechat format["TRIGGERED: %1",_x];
if (_forEachIndex > END_IDC) exitwith {}; if (_forEachIndex > END_IDC) exitWith {};
_ctrl = (_display displayCtrl (START_IDC + _forEachIndex)); _ctrl = (_display displayCtrl (START_IDC + _forEachIndex));
if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then { if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then {
_ctrl ctrlSetText (_x select 0); _ctrl ctrlSetText (_x select 0);

View File

@ -20,7 +20,7 @@ private "_target";
params ["_display"]; params ["_display"];
if (isNil "_display") exitwith {}; if (isNil "_display") exitWith {};
if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), true] call EFUNC(common,blurScreen);}; if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), true] call EFUNC(common,blurScreen);};
if (EGVAR(interact_menu,menuBackground)==2) then {0 cutRsc[QEGVAR(interact_menu,menuBackground), "PLAIN", 1, false];}; if (EGVAR(interact_menu,menuBackground)==2) then {0 cutRsc[QEGVAR(interact_menu,menuBackground), "PLAIN", 1, false];};

View File

@ -17,7 +17,7 @@
params ["_interactionTarget"]; params ["_interactionTarget"];
if (dialog || {isNull _interactionTarget}) exitwith { if (dialog || {isNull _interactionTarget}) exitWith {
disableSerialization; disableSerialization;
private ["_display", "_handled"]; private ["_display", "_handled"];

View File

@ -23,7 +23,7 @@ private["_allInjuryTexts", "_bandagedwounds", "_damaged", "_genericMessages", "_
if (isNil "_display" || {isNull _display}) exitWith {ERROR("No display");}; if (isNil "_display" || {isNull _display}) exitWith {ERROR("No display");};
_selectionN = GVAR(selectedBodyPart); _selectionN = GVAR(selectedBodyPart);
if (_selectionN < 0 || {_selectionN > 5}) exitwith {}; if (_selectionN < 0 || {_selectionN > 5}) exitWith {};
_genericMessages = []; _genericMessages = [];
_partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN; _partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN;

View File

@ -59,7 +59,7 @@ if (_newMuzzleVelocityCoefficent != 1) then {
PARAMS_2(_args,_pfID); PARAMS_2(_args,_pfID);
EXPLODE_4_PVT(_args,_shell,_airFriction,_time,_relativeDensity); EXPLODE_4_PVT(_args,_shell,_airFriction,_time,_relativeDensity);
if (isNull _shell || {!alive _shell}) exitwith { if (isNull _shell || {!alive _shell}) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler; [_pfID] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -12,9 +12,9 @@
private _logicType = typeof _logic; private _logicType = typeof _logic;
_logic hideobject true; _logic hideobject true;
if (_logic getvariable [QGVAR(initalized), false]) exitwith {}; if (_logic getvariable [QGVAR(initalized), false]) exitWith {};
private _config = (configFile >> "CfgVehicles" >> _logicType); private _config = (configFile >> "CfgVehicles" >> _logicType);
if !(isClass _config) exitwith {}; if !(isClass _config) exitWith {};
private _isGlobal = getNumber (_config >> "isGlobal") > 0; private _isGlobal = getNumber (_config >> "isGlobal") > 0;
private _isDisposable = getNumber (_config >> "isDisposable") > 0; private _isDisposable = getNumber (_config >> "isDisposable") > 0;

View File

@ -16,7 +16,7 @@
private ["_logic"]; private ["_logic"];
_logic = _this select 0; _logic = _this select 0;
if (isMultiplayer) exitwith {}; if (isMultiplayer) exitWith {};
if (_logic getvariable ["allowconfigurationExport", false]) then { if (_logic getvariable ["allowconfigurationExport", false]) then {
GVAR(serverConfigGeneration) = 1; GVAR(serverConfigGeneration) = 1;

View File

@ -18,7 +18,7 @@
private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"]; private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"];
if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitwith {closeDialog 145246;}; if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitWith {closeDialog 145246;};
// Filter only user setable setting // Filter only user setable setting
GVAR(serverSideOptions) = []; GVAR(serverSideOptions) = [];

View File

@ -24,19 +24,19 @@ TRACE_4("params",_caller,_target,_hitPoint,_className);
private ["_config", "_engineerRequired", "_items", "_locations", "_return", "_condition", "_vehicleStateCondition", "_settingName", "_settingItemsArray"]; private ["_config", "_engineerRequired", "_items", "_locations", "_return", "_condition", "_vehicleStateCondition", "_settingName", "_settingItemsArray"];
_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className);
if !(isClass _config) exitwith {false}; // or go for a default? if !(isClass _config) exitWith {false}; // or go for a default?
if(isEngineOn _target) exitwith {false}; if(isEngineOn _target) exitWith {false};
_engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then {
getNumber (_config >> "requiredEngineer"); getNumber (_config >> "requiredEngineer");
} else { } else {
// Check for required class // Check for required class
if (isText (_config >> "requiredEngineer")) exitwith { if (isText (_config >> "requiredEngineer")) exitWith {
missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0]; missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0];
}; };
0; 0;
}; };
if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitwith {false}; if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false};
//Items can be an array of required items or a string to a ACE_Setting array //Items can be an array of required items or a string to a ACE_Setting array
_items = if (isArray (_config >> "items")) then { _items = if (isArray (_config >> "items")) then {
@ -49,7 +49,7 @@ _items = if (isArray (_config >> "items")) then {
}; };
_settingItemsArray select (missionNamespace getVariable _settingName); _settingItemsArray select (missionNamespace getVariable _settingName);
}; };
if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitwith {false}; if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false};
_return = true; _return = true;
if (getText (_config >> "condition") != "") then { if (getText (_config >> "condition") != "") then {
@ -66,27 +66,27 @@ if (getText (_config >> "condition") != "") then {
}; };
}; };
if (!_return) exitwith {false}; if (!_return) exitWith {false};
_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then {
missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0]
} else { } else {
getNumber(_config >> "vehicleStateCondition") getNumber(_config >> "vehicleStateCondition")
}; };
// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; // if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false};
_locations = getArray (_config >> "repairLocations"); _locations = getArray (_config >> "repairLocations");
if ("All" in _locations) exitwith {true}; if ("All" in _locations) exitWith {true};
private ["_repairFacility", "_repairVeh"]; private ["_repairFacility", "_repairVeh"];
_repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))};
_repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))};
{ {
if (_x == "field") exitwith {_return = true;}; if (_x == "field") exitWith {_return = true;};
if (_x == "RepairFacility" && _repairFacility) exitwith {_return = true;}; if (_x == "RepairFacility" && _repairFacility) exitWith {_return = true;};
if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;}; if (_x == "RepairVehicle" && _repairVeh) exitWith {_return = true;};
if !(isnil _x) exitwith { if !(isnil _x) exitWith {
private "_val"; private "_val";
_val = missionNamespace getVariable _x; _val = missionNamespace getVariable _x;
if (typeName _val == "SCALAR") then { if (typeName _val == "SCALAR") then {

View File

@ -21,7 +21,7 @@
params ["_unit", "_target", "_hitPoint", ["_wheel", false]]; params ["_unit", "_target", "_hitPoint", ["_wheel", false]];
TRACE_4("params",_unit,_target,_hitPoint,_wheel); TRACE_4("params",_unit,_target,_hitPoint,_wheel);
// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action // TODO [_unit, _wheel] call EFUNC(common,claim); on start of action
//if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false}; //if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitWith {false};
if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false};

View File

@ -31,7 +31,7 @@ _wheel = objNull;
_wheel = _x; _wheel = _x;
}; };
} forEach nearestObjects [_unit, ["ACE_Track"], 5]; } forEach nearestObjects [_unit, ["ACE_Track"], 5];
if (isNull _wheel) exitwith {}; if (isNull _wheel) exitWith {};
// get current hitpoint damage // get current hitpoint damage

View File

@ -31,7 +31,7 @@ _wheel = objNull;
_wheel = _x; _wheel = _x;
}; };
} forEach nearestObjects [_unit, ["ACE_Track"], 5]; } forEach nearestObjects [_unit, ["ACE_Track"], 5];
if (isNull _wheel) exitwith {}; if (isNull _wheel) exitWith {};
// get current hitpoint damage // get current hitpoint damage
_hitPointDamage = _vehicle getHitPointDamage _hitPoint; _hitPointDamage = _vehicle getHitPointDamage _hitPoint;

View File

@ -31,7 +31,7 @@ _wheel = objNull;
_wheel = _x; _wheel = _x;
}; };
} forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; } forEach nearestObjects [_unit, ["ACE_Wheel"], 5];
if (isNull _wheel) exitwith {}; if (isNull _wheel) exitWith {};
// get current hitpoint damage // get current hitpoint damage
_hitPointDamage = _vehicle getHitPointDamage _hitPoint; _hitPointDamage = _vehicle getHitPointDamage _hitPoint;

View File

@ -19,7 +19,7 @@ params ["_unit"];
TRACE_1("params",_unit); TRACE_1("params",_unit);
// TODO when near repair station, full repair? // TODO when near repair station, full repair?
if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitwith {0}; if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitWith {0};
if ([_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold_Engineer)}; if ([_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold_Engineer)};
if ([_unit, GVAR(engineerSetting_Repair)] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold)}; if ([_unit, GVAR(engineerSetting_Repair)] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold)};

View File

@ -23,10 +23,10 @@ private ["_return"];
_return = true; _return = true;
{ {
if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith { if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitWith {
_return = false; _return = false;
}; };
if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith { if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitWith {
_return = false; _return = false;
}; };
} forEach _items; } forEach _items;

View File

@ -26,7 +26,7 @@ _repairFacility = [];
_objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]); _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]);
{ {
if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitwith { if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitWith {
_isInBuilding = true; _isInBuilding = true;
}; };
} forEach _objects; } forEach _objects;
@ -34,7 +34,7 @@ _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position sel
if (!_isInBuilding) then { if (!_isInBuilding) then {
_objects = position _object nearObjects 7.5; _objects = position _object nearObjects 7.5;
{ {
if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitwith { if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitWith {
_isInBuilding = true; _isInBuilding = true;
}; };
} forEach _objects; } forEach _objects;

View File

@ -24,7 +24,7 @@ _nearObjects = nearestObjects [_unit, ["Air","LandVehicle"], 20];
_return = false; _return = false;
{ {
if ([_x] call FUNC(isRepairVehicle)) exitwith {_return = true;}; if ([_x] call FUNC(isRepairVehicle)) exitWith {_return = true;};
} forEach _nearObjects; } forEach _nearObjects;
_return; _return;

View File

@ -18,6 +18,6 @@
params ["_vehicle"]; params ["_vehicle"];
TRACE_1("params",_vehicle); TRACE_1("params",_vehicle);
if (_vehicle isKindOf "CAManBase") exitwith {false}; if (_vehicle isKindOf "CAManBase") exitWith {false};
((_vehicle getVariable ["ACE_isRepairVehicle", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(canRepair))]) > 0); ((_vehicle getVariable ["ACE_isRepairVehicle", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(canRepair))]) > 0);

View File

@ -24,19 +24,19 @@ TRACE_4("params",_calller,_target,_hitPoint,_className);
private["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_locations", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray"]; private["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_locations", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray"];
_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className);
if !(isClass _config) exitwith {false}; // or go for a default? if !(isClass _config) exitWith {false}; // or go for a default?
_engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then {
getNumber (_config >> "requiredEngineer"); getNumber (_config >> "requiredEngineer");
} else { } else {
// Check for required class // Check for required class
if (isText (_config >> "requiredEngineer")) exitwith { if (isText (_config >> "requiredEngineer")) exitWith {
missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0]; missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0];
}; };
0; 0;
}; };
if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitwith {false}; if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false};
if (isEngineOn _target) exitwith {false}; if (isEngineOn _target) exitWith {false};
//Items can be an array of required items or a string to a ACE_Setting array //Items can be an array of required items or a string to a ACE_Setting array
_items = if (isArray (_config >> "items")) then { _items = if (isArray (_config >> "items")) then {
@ -49,7 +49,7 @@ _items = if (isArray (_config >> "items")) then {
}; };
_settingItemsArray select (missionNamespace getVariable _settingName); _settingItemsArray select (missionNamespace getVariable _settingName);
}; };
if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitwith {false}; if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false};
_return = true; _return = true;
if (getText (_config >> "condition") != "") then { if (getText (_config >> "condition") != "") then {
@ -65,27 +65,27 @@ if (getText (_config >> "condition") != "") then {
_return = [_caller, _target, _hitPoint, _className] call _condition; _return = [_caller, _target, _hitPoint, _className] call _condition;
}; };
}; };
if (!_return) exitwith {false}; if (!_return) exitWith {false};
_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then {
missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0]
} else { } else {
getNumber(_config >> "vehicleStateCondition") getNumber(_config >> "vehicleStateCondition")
}; };
// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; // if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false};
_locations = getArray (_config >> "repairLocations"); _locations = getArray (_config >> "repairLocations");
if ("All" in _locations) exitwith {true}; if ("All" in _locations) exitWith {true};
private ["_repairFacility", "_repairVeh"]; private ["_repairFacility", "_repairVeh"];
_repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))};
_repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))};
{ {
if (_x == "field") exitwith {_return = true;}; if (_x == "field") exitWith {_return = true;};
if (_x == "RepairFacility" && _repairFacility) exitwith {_return = true;}; if (_x == "RepairFacility" && _repairFacility) exitWith {_return = true;};
if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;}; if (_x == "RepairVehicle" && _repairVeh) exitWith {_return = true;};
if !(isnil _x) exitwith { if !(isnil _x) exitWith {
private "_val"; private "_val";
_val = missionNamespace getVariable _x; _val = missionNamespace getVariable _x;
if (typeName _val == "SCALAR") then { if (typeName _val == "SCALAR") then {
@ -100,13 +100,13 @@ _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC
}; };
} forEach _locations; } forEach _locations;
if !(_return && alive _target) exitwith {false}; if !(_return && alive _target) exitWith {false};
_consumeItems = if (isNumber (_config >> "itemConsumed")) then { _consumeItems = if (isNumber (_config >> "itemConsumed")) then {
getNumber (_config >> "itemConsumed"); getNumber (_config >> "itemConsumed");
} else { } else {
// Check for required class // Check for required class
if (isText (_config >> "itemConsumed")) exitwith { if (isText (_config >> "itemConsumed")) exitWith {
missionNamespace getVariable [(getText (_config >> "itemConsumed")), 0]; missionNamespace getVariable [(getText (_config >> "itemConsumed")), 0];
}; };
0; 0;
@ -160,14 +160,14 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then {
_repairTime = if (isNumber (_config >> "repairingTime")) then { _repairTime = if (isNumber (_config >> "repairingTime")) then {
getNumber (_config >> "repairingTime"); getNumber (_config >> "repairingTime");
} else { } else {
if (isText (_config >> "repairingTime")) exitwith { if (isText (_config >> "repairingTime")) exitWith {
_repairTimeConfig = getText(_config >> "repairingTime"); _repairTimeConfig = getText(_config >> "repairingTime");
if (isnil _repairTimeConfig) then { if (isnil _repairTimeConfig) then {
_repairTimeConfig = compile _repairTimeConfig; _repairTimeConfig = compile _repairTimeConfig;
} else { } else {
_repairTimeConfig = missionNamespace getVariable _repairTimeConfig; _repairTimeConfig = missionNamespace getVariable _repairTimeConfig;
}; };
if (typeName _repairTimeConfig == "SCALAR") exitwith { if (typeName _repairTimeConfig == "SCALAR") exitWith {
_repairTimeConfig; _repairTimeConfig;
}; };
[_caller, _target, _hitPoint, _className] call _repairTimeConfig; [_caller, _target, _hitPoint, _className] call _repairTimeConfig;

View File

@ -19,7 +19,7 @@
params ["_unit", "_item"]; params ["_unit", "_item"];
TRACE_2("params",_unit,_item); TRACE_2("params",_unit,_item);
if ([_unit, _item] call EFUNC(common,hasItem)) exitwith { if ([_unit, _item] call EFUNC(common,hasItem)) exitWith {
[[_unit, _item], QUOTE(EFUNC(common,useItem)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [[_unit, _item], QUOTE(EFUNC(common,useItem)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[true, _unit]; [true, _unit];
}; };

View File

@ -27,14 +27,14 @@ _itemsUsedBy = [];
if (typeName _x == "ARRAY") then { if (typeName _x == "ARRAY") then {
{ {
_itemUsedInfo = [_unit, _x] call FUNC(useItem); _itemUsedInfo = [_unit, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
} forEach _x; } forEach _x;
}; };
// handle required item // handle required item
if (typeName _x == "STRING") then { if (typeName _x == "STRING") then {
_itemUsedInfo = [_unit, _x] call FUNC(useItem); _itemUsedInfo = [_unit, _x] call FUNC(useItem);
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
}; };
} forEach _items; } forEach _items;

View File

@ -177,7 +177,7 @@ switch (toLower _mode) do {
}; };
// Handle held keys (prevent repeat calling) // Handle held keys (prevent repeat calling)
if (GVAR(heldKeys) param [_dik,false]) exitwith {}; if (GVAR(heldKeys) param [_dik,false]) exitWith {};
// Exclude movement/adjustment keys so that speed can be adjusted on fly // Exclude movement/adjustment keys so that speed can be adjusted on fly
if !(_dik in [16,17,30,31,32,44,74,78]) then { if !(_dik in [16,17,30,31,32,44,74,78]) then {
GVAR(heldKeys) set [_dik,true]; GVAR(heldKeys) set [_dik,true];

View File

@ -27,7 +27,7 @@ params [["_set",true,[true]], ["_force",true,[true]]];
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
// Exit if no change // Exit if no change
if (_set isEqualTo GVAR(isSet)) exitwith {}; if (_set isEqualTo GVAR(isSet)) exitWith {};
// Handle common addon audio // Handle common addon audio
if (["ace_hearing"] call EFUNC(common,isModLoaded)) then { if (["ace_hearing"] call EFUNC(common,isModLoaded)) then {

View File

@ -26,7 +26,7 @@ params [["_unit",player,[objNull]], ["_set",true,[true]]];
// No change, no service (but allow spectators to be reset) // No change, no service (but allow spectators to be reset)
if !(_set || (GETVAR(_unit,GVAR(isStaged),false))) exitWith {}; if !(_set || (GETVAR(_unit,GVAR(isStaged),false))) exitWith {};
if !(local _unit) exitwith { if !(local _unit) exitWith {
[[_unit, _set], QFUNC(stageSpectator), _unit] call EFUNC(common,execRemoteFnc); [[_unit, _set], QFUNC(stageSpectator), _unit] call EFUNC(common,execRemoteFnc);
}; };

View File

@ -16,7 +16,7 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
if !(GVAR(DisplayText)) exitwith {}; if !(GVAR(DisplayText)) exitWith {};
params ["_magazine", "_numberofGrenades"]; params ["_magazine", "_numberofGrenades"];

View File

@ -13,11 +13,11 @@
#include "script_component.hpp" #include "script_component.hpp"
if (!isServer) exitwith {}; if (!isServer) exitWith {};
params ["_object"]; params ["_object"];
if (!(_object getvariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitwith {}; if (!(_object getvariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {};
{ {
_x addCuratorEditableObjects [[_object], true]; _x addCuratorEditableObjects [[_object], true];

Some files were not shown because too many files have changed in this diff Show More