mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed advancedLocal treatment function. Now also selects primary weapon of caller when performing treatment.
This commit is contained in:
parent
e7ebcbe3fb
commit
b173b21c51
@ -36,12 +36,13 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {
|
||||
|
||||
if (!([_caller, _target, _removeItem] call FUNC(hasEquipment)) && _removeItem != "") exitwith {
|
||||
[_caller, false] call FUNC(treatmentMutex);
|
||||
false;
|
||||
};
|
||||
|
||||
if (primaryWeapon _caller == "") then {
|
||||
_caller addWeapon "ACE_FakePrimaryWeapon";
|
||||
};
|
||||
_caller selectWeapon (primaryWeapon _unit);
|
||||
_caller selectWeapon (primaryWeapon _caller);
|
||||
|
||||
// TODO make dynamic
|
||||
switch (toLower _category) do {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* fn_heal.sqf
|
||||
* fnc_handleTreatment_Action_AdvancedLocal.sqf
|
||||
* @Descr: N/A
|
||||
* @Author: Glowbal
|
||||
*
|
||||
@ -19,26 +19,27 @@ _prevAnim = _this select 4;
|
||||
|
||||
// TODO old code, has to be replaced by something more dynamic.
|
||||
_attributes = switch (_removeItem) do {
|
||||
case "cse_blood_iv": {["cse_bloodIVVolume",1000,"Blood IV"]};
|
||||
case "cse_saline_iv": {["cse_salineIVVolume",1000,"Saline IV"]};
|
||||
case "cse_plasma_iv": {["cse_plasmaIVVolume",1000,"Plasma IV"]};
|
||||
case "ACE_blood_iv": {[QGVAR(bloodIVVolume),1000,"Blood IV"]};
|
||||
case "ACE_saline_iv": {[QGVAR(salineIVVolume),1000,"Saline IV"]};
|
||||
case "ACE_plasma_iv": {[QGVAR(plasmaIVVolume),1000,"Plasma IV"]};
|
||||
|
||||
case "cse_blood_iv_500": {["cse_bloodIVVolume",500,"Blood IV"]};
|
||||
case "cse_saline_iv_500": {["cse_salineIVVolume",500,"Saline IV"]};
|
||||
case "cse_plasma_iv_500": {["cse_plasmaIVVolume",500,"Plasma IV"]};
|
||||
case "ACE_blood_iv_500": {[QGVAR(bloodIVVolume),500,"Blood IV"]};
|
||||
case "ACE_saline_iv_500": {[QGVAR(salineIVVolume),500,"Saline IV"]};
|
||||
case "ACE_plasma_iv_500": {[QGVAR(plasmaIVVolume),500,"Plasma IV"]};
|
||||
|
||||
case "cse_blood_iv_250": {["cse_bloodIVVolume",250,"Blood IV"]};
|
||||
case "cse_saline_iv_250": {["cse_salineIVVolume",250,"Saline IV"]};
|
||||
case "cse_plasma_iv_250": {["cse_plasmaIVVolume",250,"Plasma IV"]};
|
||||
case "ACE_blood_iv_250": {[QGVAR(bloodIVVolume),250,"Blood IV"]};
|
||||
case "ACE_saline_iv_250": {[QGVAR(salineIVVolume),250,"Saline IV"]};
|
||||
case "ACE_plasma_iv_250": {[QGVAR(plasmaIVVolume),250,"Plasma IV"]};
|
||||
|
||||
default {[]};
|
||||
};
|
||||
|
||||
if (count _attributes > 1) then {
|
||||
_value = [_target,(_attributes select 0)] call EFUNC(common,getDefinedVariable);
|
||||
_value = _value + (_attributes select 1);
|
||||
[_target,(_attributes select 0),_value] call EFUNC(common,setDefinedVariable);
|
||||
|
||||
// TODO localization
|
||||
[_target,"treatment",format["%1 has given %4 a %2(%3ml)",[_caller] call cse_fnc_getName,_attributes select 2,_attributes select 1,_target]] call FUNC(addActivityToLog);
|
||||
[_target,"treatment",format["%1 has given %4 a %2(%3ml)",[_caller] call EFUNC(common,getName),_attributes select 2,_attributes select 1,_target]] call FUNC(addActivityToLog);
|
||||
[_target,_removeItem] call FUNC(addToTriageList);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user