Fixed script errors

This commit is contained in:
Glowbal 2015-02-28 18:59:37 +01:00
parent 9986fddf6b
commit f1445a4c45
8 changed files with 17 additions and 18 deletions

View File

@ -41,7 +41,7 @@ PREP(treatmentBasic_bandage);
PREP(treatmentBasic_morphine); PREP(treatmentBasic_morphine);
PREP(treatmentBasic_epipen); PREP(treatmentBasic_epipen);
PREP(treatmentBasic_bloodbag); PREP(treatmentBasic_bloodbag);
PREP(teatmentIV); PREP(treatmentIV);
PREP(treatmentIVLocal); PREP(treatmentIVLocal);
PREP(treatmentTourniquet); PREP(treatmentTourniquet);
PREP(treatmentTourniquetLocal); PREP(treatmentTourniquetLocal);
@ -55,7 +55,7 @@ PREP(actionCheckPulseLocal);
PREP(actionCheckResponse); PREP(actionCheckResponse);
PREP(actionRemoveTourniquet); PREP(actionRemoveTourniquet);
PREP(onTreatmentCompleted); PREP(onTreatmentCompleted);
PREP(onMedicationUsed); PREP(onMedicationUsage);
PREP(reactionToDamage); PREP(reactionToDamage);
PREP(useItem); PREP(useItem);
PREP(useItems); PREP(useItems);

View File

@ -56,8 +56,8 @@ _unit setvariable [QGVAR(airwayCollapsed), true, true];
// generic medical admin // generic medical admin
_unit setvariable [QGVAR(addedToUnitLoop), false, true]; _unit setvariable [QGVAR(addedToUnitLoop), false, true];
_unit setvariable [QGVAR(inCardiacArrest), true,true]; _unit setvariable [QGVAR(inCardiacArrest), true, true];
_unit setVariable [QGVAR(isUnconscious), false, true] _unit setVariable [QGVAR(isUnconscious), false, true];
_unit setvariable [QGVAR(hasLostBlood), true, true]; _unit setvariable [QGVAR(hasLostBlood), true, true];
_unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(isBleeding), false, true];
_unit setvariable [QGVAR(hasPain), false, true]; _unit setvariable [QGVAR(hasPain), false, true];

View File

@ -16,6 +16,8 @@
* Public: No * Public: No
*/ */
#include "script_component.hpp"
private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount"]; private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount"];
_target = _this select 0; _target = _this select 0;
_className = _this select 1; _className = _this select 1;

View File

@ -80,7 +80,8 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific");
_woundTypes = []; _woundTypes = [];
_type = _x; _type = _x;
{ {
if (_type in (_x select 4)) then { // Check if this type is in the causes of a wound class, if so, we will store the wound types for this damage type
if (_type in (_x select 5)) then {
_woundTypes pushback _x; _woundTypes pushback _x;
}; };
}foreach _allWoundClasses; }foreach _allWoundClasses;

View File

@ -99,7 +99,7 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then {
_iconDisplayed = getText (_config >> "actionIconPath"); _iconDisplayed = getText (_config >> "actionIconPath");
if (_iconDisplayed != "") then { if (_iconDisplayed != "") then {
[QGVAR(treatmentActionIcon), true, _iconDisplayed, [1,1,1,1], getNumber(_config >> "actionIconDisplayTime");] call EFUNC(common,displayIcon); [QGVAR(treatmentActionIcon), true, _iconDisplayed, [1,1,1,1], getNumber(_config >> "actionIconDisplayTime")] call EFUNC(common,displayIcon);
}; };
// handle display of text/hints // handle display of text/hints
@ -111,7 +111,7 @@ if (_target != _caller) then {
}; };
if (_displayText != "") then { if (_displayText != "") then {
["displayTextStructured", [_caller], [[_displayText, [_caller] call EFUNC(getName), [_target] call EFUNC(getName)], 1.5, _caller]] call EFUNC(common,targetEvent); ["displayTextStructured", [_caller], [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent);
}; };

View File

@ -10,7 +10,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_unit", "_caller"]; private ["_unit", "_caller", "_allUsedMedication"];
_unit = _this select 0; _unit = _this select 0;
_caller = _this select 1; _caller = _this select 1;
@ -30,7 +30,7 @@ if (alive _unit) exitwith {
// vitals // vitals
_unit setVariable [QGVAR(heartRate), 80]; _unit setVariable [QGVAR(heartRate), 80];
_unit setvariable [QGVAR(heartRateAdjustments), []]; _unit setvariable [QGVAR(heartRateAdjustments), []];
_unit setvariable [QGVAR(bloodPressure), [80, 120]]; _unit setvariable [QGVAR(bloodPressure), [80, 120]];
_unit setVariable [QGVAR(peripheralResistance), 100]; _unit setVariable [QGVAR(peripheralResistance), 100];
// fractures // fractures
@ -51,22 +51,18 @@ if (alive _unit) exitwith {
// generic medical admin // generic medical admin
_unit setvariable [QGVAR(addedToUnitLoop), false, true]; _unit setvariable [QGVAR(addedToUnitLoop), false, true];
_unit setvariable [QGVAR(inCardiacArrest), true,true]; _unit setvariable [QGVAR(inCardiacArrest), true, true];
_unit setVariable [QGVAR(isUnconscious), false, true] _unit setVariable [QGVAR(isUnconscious), false, true];
_unit setvariable [QGVAR(hasLostBlood), true, true]; _unit setvariable [QGVAR(hasLostBlood), true, true];
_unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(isBleeding), false, true];
_unit setvariable [QGVAR(hasPain), false, true]; _unit setvariable [QGVAR(hasPain), false, true];
// medication // medication
_allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []];
{ {
_unit setvariable [_x select 0, nil]; _unit setvariable [_x select 0, nil];
}foreach _allUsedMedication; }foreach _allUsedMedication;
// Resetting damage // Resetting damage
_unit setDamage 0; _unit setDamage 0;
["Medical_onFullyHealed", [_unit, true]] call ace_common_fnc_localEvent;
[format["Completed healLocal %1", _this]] call EFUNC(common,debug);
}; };
["Medical_onFullyHealed", [_unit, false]] call ace_common_fnc_localEvent;

View File

@ -18,7 +18,7 @@
#include "script_component.hpp" #include "script_component.hpp"
_medic = _this select 0; _medic = _this select 0;
_patient = _this select 1: _patient = _this select 1;
_items = _this select 4; _items = _this select 4;
[_patient, false] call FUNC(setUnconscious); [_patient, false] call FUNC(setUnconscious);

View File

@ -18,7 +18,7 @@
#include "script_component.hpp" #include "script_component.hpp"
_medic = _this select 0; _medic = _this select 0;
_patient = _this select 1: _patient = _this select 1;
_items = _this select 4; _items = _this select 4;
[_patient, false] call FUNC(setUnconscious); [_patient, false] call FUNC(setUnconscious);