From f1445a4c45db768172428e298d3f92379901bdcd Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 28 Feb 2015 18:59:37 +0100 Subject: [PATCH] Fixed script errors --- addons/medical/XEH_preInit.sqf | 4 ++-- addons/medical/functions/fnc_init.sqf | 4 ++-- addons/medical/functions/fnc_onMedicationUsage.sqf | 2 ++ .../functions/fnc_parseConfigForInjuries.sqf | 3 ++- addons/medical/functions/fnc_treatment.sqf | 4 ++-- .../fnc_treatmentAdvanced_fullHealLocal.sqf | 14 +++++--------- .../functions/fnc_treatmentBasic_bloodbag.sqf | 2 +- .../functions/fnc_treatmentBasic_epipen.sqf | 2 +- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 27873a1c84..081289545c 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -41,7 +41,7 @@ PREP(treatmentBasic_bandage); PREP(treatmentBasic_morphine); PREP(treatmentBasic_epipen); PREP(treatmentBasic_bloodbag); -PREP(teatmentIV); +PREP(treatmentIV); PREP(treatmentIVLocal); PREP(treatmentTourniquet); PREP(treatmentTourniquetLocal); @@ -55,7 +55,7 @@ PREP(actionCheckPulseLocal); PREP(actionCheckResponse); PREP(actionRemoveTourniquet); PREP(onTreatmentCompleted); -PREP(onMedicationUsed); +PREP(onMedicationUsage); PREP(reactionToDamage); PREP(useItem); PREP(useItems); diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 37889f7eec..54330a8733 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -56,8 +56,8 @@ _unit setvariable [QGVAR(airwayCollapsed), true, true]; // generic medical admin _unit setvariable [QGVAR(addedToUnitLoop), false, true]; -_unit setvariable [QGVAR(inCardiacArrest), true,true]; -_unit setVariable [QGVAR(isUnconscious), false, true] +_unit setvariable [QGVAR(inCardiacArrest), true, true]; +_unit setVariable [QGVAR(isUnconscious), false, true]; _unit setvariable [QGVAR(hasLostBlood), true, true]; _unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(hasPain), false, true]; diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index 61ca569db8..19115b739d 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -16,6 +16,8 @@ * Public: No */ +#include "script_component.hpp" + private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount"]; _target = _this select 0; _className = _this select 1; diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 7e4843ca2e..33624cbaf4 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -80,7 +80,8 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); _woundTypes = []; _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; }; }foreach _allWoundClasses; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index c514ceb517..27579ca54d 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -99,7 +99,7 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { _iconDisplayed = getText (_config >> "actionIconPath"); 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 @@ -111,7 +111,7 @@ if (_target != _caller) 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); }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index 77e41082d8..b8ac6999ea 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -private ["_unit", "_caller"]; +private ["_unit", "_caller", "_allUsedMedication"]; _unit = _this select 0; _caller = _this select 1; @@ -30,7 +30,7 @@ if (alive _unit) exitwith { // vitals _unit setVariable [QGVAR(heartRate), 80]; _unit setvariable [QGVAR(heartRateAdjustments), []]; - _unit setvariable [QGVAR(bloodPressure), [80, 120]]; + _unit setvariable [QGVAR(bloodPressure), [80, 120]]; _unit setVariable [QGVAR(peripheralResistance), 100]; // fractures @@ -51,22 +51,18 @@ if (alive _unit) exitwith { // generic medical admin _unit setvariable [QGVAR(addedToUnitLoop), false, true]; - _unit setvariable [QGVAR(inCardiacArrest), true,true]; - _unit setVariable [QGVAR(isUnconscious), false, true] + _unit setvariable [QGVAR(inCardiacArrest), true, true]; + _unit setVariable [QGVAR(isUnconscious), false, true]; _unit setvariable [QGVAR(hasLostBlood), true, true]; _unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(hasPain), false, true]; // medication - _allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; + _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; { _unit setvariable [_x select 0, nil]; }foreach _allUsedMedication; // Resetting damage _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; \ No newline at end of file diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf index ceb23bc201..0505028b8e 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf @@ -18,7 +18,7 @@ #include "script_component.hpp" _medic = _this select 0; -_patient = _this select 1: +_patient = _this select 1; _items = _this select 4; [_patient, false] call FUNC(setUnconscious); diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index ceb23bc201..0505028b8e 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -18,7 +18,7 @@ #include "script_component.hpp" _medic = _this select 0; -_patient = _this select 1: +_patient = _this select 1; _items = _this select 4; [_patient, false] call FUNC(setUnconscious);