fix tourniquets

This commit is contained in:
commy2 2016-10-13 10:12:28 +02:00
parent 18907adcd5
commit e1cbeeea16
5 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,6 @@ PREP(getBloodPressure);
PREP(getBloodVolumeChange);
PREP(getCardiacOutput);
PREP(getHeartRateChange);
PREP(hasTourniquetAppliedTo);
PREP(init);
PREP(install);
PREP(isInMedicalFacility);
@ -30,3 +29,5 @@ PREP(handleMedications);
PREP(addPain);
PREP(setUnconscious);
PREP(setDead);
PREP(hasTourniquetAppliedTo);

View File

@ -78,7 +78,7 @@ class GVAR(Actions) {
items[] = {"ACE_tourniquet"};
treatmentTime = 4;
callbackSuccess = QFUNC(treatmentTourniquet);
condition = QUOTE(!([ARR_2(_target,_selectionName)] call EFUNC(medical,hasTourniquetAppliedTo)));
condition = QUOTE(!([ARR_2(_target,_bodyPart)] call EFUNC(medical,hasTourniquetAppliedTo)));
litter[] = {};
};
class RemoveTourniquet: Tourniquet {
@ -87,7 +87,7 @@ class GVAR(Actions) {
items[] = {};
treatmentTime = 2.5;
callbackSuccess = QFUNC(actionRemoveTourniquet);
condition = QUOTE([ARR_2(_target,_selectionName)] call EFUNC(medical,hasTourniquetAppliedTo));
condition = QUOTE([ARR_2(_target,_bodyPart)] call EFUNC(medical,hasTourniquetAppliedTo));
};
// --- syringes

View File

@ -9,6 +9,7 @@ if (isServer) then {
// treatment events
[QGVAR(treatmentBandageLocal), FUNC(treatmentBandageLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentTourniquetLocal), FUNC(treatmentTourniquetLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentMorphineLocal), FUNC(treatmentMorphineLocal)] call CBA_fnc_addEventHandler;
//[QGVAR(treatmentEpipenLocal), FUNC(treatmentEpipenLocal)] call CBA_fnc_addEventHandler;
[QGVAR(treatmentMedicationLocal), FUNC(treatmentMedicationLocal)] call CBA_fnc_addEventHandler;

View File

@ -32,7 +32,7 @@ _tourniquets set [_partIndex, 0];
_target setVariable [QEGVAR(medical,tourniquets), _tourniquets, true];
// Adding the tourniquet item to the caller
_caller addItem "ACE_tourniquet";
[_caller, "ACE_tourniquet", true] call CBA_fnc_addItem;
//Handle all injected medications now that blood is flowing:
private _delayedMedications = _target getVariable [QGVAR(occludedMedications), []];

View File

@ -21,19 +21,17 @@ if (count _items == 0) exitWith {false};
private _partIndex = ALL_BODY_PARTS find toLower _bodyPart;
if (_partIndex == 0 || _partIndex == 1) exitWith {false};
private _tourniquets = _target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]];
if (_tourniquets select _partIndex > 0) exitWith {
_output = "There is already a tourniquet on this body part!"; // TODO localization
[QEGVAR(common,displayTextStructured), [_output, 1.5, _caller], [_caller]] call CBA_fnc_targetEvent;
private _output = "There is already a tourniquet on this body part!"; // TODO localization
[QEGVAR(common,displayTextStructured), [_output, 1.5, _caller], _caller] call CBA_fnc_targetEvent;
false
};
private _removeItem = _items select 0;
[QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _selectionName], _target] call CBA_fnc_targetEvent;
[QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _bodyPart], _target] call CBA_fnc_targetEvent;
[_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", ELSTRING(medical,Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);