Skip to content

Commit

Permalink
Chemical/Misc/Surgery/Pharma - Fix Hashmap retrieval, inheritance and…
Browse files Browse the repository at this point in the history
… CWMP issues (#557)

**When merged this pull request will:**
- _Fix errors due to ACE inheritance changes where the game would not
even launch_
- _Fix error in inheritace for quadbike stretcher position points_
- _Fix error in medical menu due to ACE Hashmap change for fnc_treatment
that we have modified_
- _Fix wrong CSTRING for CWMP_
- _Fix wrong CWMP callback success referencing old Painkillers fnc_

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.

---------

Co-authored-by: MiszczuZPolski <[email protected]>
  • Loading branch information
YetheSamartaka and MiszczuZPolski authored Jul 20, 2024
1 parent ee92156 commit d0e4502
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 103 deletions.
2 changes: 1 addition & 1 deletion addons/chemical/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class CfgVehicles {
};
};
class Mortar_01_base_F: StaticMortar {
class ace_csw: ace_csw {
class ace_csw {
proxyWeapon = "ace_mortar_82mm";
};

Expand Down
4 changes: 2 additions & 2 deletions addons/chemical/functions/fnc_ui_gasModule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ private _fnc_onConfirm = {
};


_display displayAddEventHandler ["unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm];
_display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];

163 changes: 80 additions & 83 deletions addons/misc/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ class CfgVehicles {
class CAManBase: Man {
class ACE_Actions {
class ACE_MainActions {
class KAT_UnloadAndCarryPatient {
displayName = CSTRING(CarryPatient);
condition = QUOTE(_target getVariable [ARR_2('ACE_isUnconscious',false)] && {!(isNull (objectParent _target))} && {isNull (objectParent _player)});
statement = QUOTE([ARR_2(_player,_target)] call FUNC(unloadAndCarryPatient));
icon = QACEPATHTOF(dragging,UI\icons\person_carry.paa);
};
class KAT_IFAK_Item {
displayName = CSTRING(IFAK_Unpack);
condition = QUOTE([ARR_4(_target,'kat_IFAK',0,0)] call FUNC(FAK_checkSlot) && !([_target] call ACEFUNC(common,isAwake)));
Expand Down Expand Up @@ -479,6 +485,78 @@ class CfgVehicles {
};
};
};
class ACE_ArmLeft {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'hand_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'hand_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'hand_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_ArmRight {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'hand_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'hand_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'hand_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_LegLeft {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'leg_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'leg_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'leg_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_LegRight {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'leg_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'leg_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'leg_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
};
class ACE_SelfActions
{
Expand Down Expand Up @@ -1271,89 +1349,6 @@ class CfgVehicles {
};
};
};

class ACE_Actions {
class ACE_ArmLeft {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'hand_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'hand_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'hand_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_ArmRight {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'hand_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'hand_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'hand_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'hand_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_LegLeft {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'leg_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_l', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'leg_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_l', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'leg_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_l', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_LegRight {
class SalineIV;
class SalineIV_Stand: SalineIV {
displayName = CSTRING(Display_IVStand);
condition = "[_player, _target, 'leg_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_r', 'SalineIV_Stand'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_500: SalineIV {
displayName = CSTRING(Display_IVStand_500);
condition = "[_player, _target, 'leg_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_r', 'SalineIV_Stand_500'] call ace_medical_treatment_fnc_treatment";
};
class SalineIV_Stand_250: SalineIV {
displayName = CSTRING(Display_IVStand_250);
condition = "[_player, _target, 'leg_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_canTreatCached";
statement = "[_player, _target, 'leg_r', 'SalineIV_Stand_250'] call ace_medical_treatment_fnc_treatment";
};
};
class ACE_MainActions {
class KAT_UnloadAndCarryPatient {
displayName = CSTRING(CarryPatient);
condition = QUOTE(_target getVariable [ARR_2('ACE_isUnconscious',false)] && {!(isNull (objectParent _target))} && {isNull (objectParent _player)});
statement = QUOTE([ARR_2(_player,_target)] call FUNC(unloadAndCarryPatient));
icon = QACEPATHTOF(dragging,UI\icons\person_carry.paa);
};
};
};
};

class LandVehicle;
Expand All @@ -1373,6 +1368,8 @@ class CfgVehicles {

class Car_F: Car {};
class Quadbike_01_base_F: Car_F {
stretcherPos[] = {0,0.8,-0.56};
stretcherVector[] = {{1, 0, 0}, {0, 0, 1}};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
class KAT_UnloadAndCarryPatient {
Expand Down
5 changes: 0 additions & 5 deletions addons/misc/vehicle_stretcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ class B_Heli_Transport_01_F: Heli_Transport_01_base_F {
stretcherPos[] = {0,1.6,-1.55};
stretcherVector[] = {{1, 0, 0}, {0, 0, 1}};
};
class Quadbike_01_base_F;
class B_Quadbike_01_F: Quadbike_01_base_F {
stretcherPos[] = {0,0.8,-0.56};
stretcherVector[] = {{1, 0, 0}, {0, 0, 1}};
};
class B_Truck_01_transport_F;
class B_Truck_01_medical_F: B_Truck_01_transport_F {
stretcherPos[] = {-0.15,-4.7,0};
Expand Down
4 changes: 2 additions & 2 deletions addons/pharma/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ class ACE_Medical_Treatment_Actions {
callbackSuccess = QFUNC(medication);
};
class CWMP: Morphine {
displayName = CSTRING(Use_CWMP);
displayName = CSTRING(Give_CWMP);
displayNameProgress = CSTRING(Using);
allowedSelections[] = {"Head"};
items[] = {"kat_Painkiller"};
condition = QUOTE(!(_patient getVariable [ARR_2(QQEGVAR(airway,recovery),false)]));
callbackSuccess = QFUNC(treatmentAdvanced_Painkillers);
callbackSuccess = QFUNC(treatmentAdvanced_CWMP);
icon = QPATHTOF(ui\icon_painkillers_action.paa);
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
Expand Down
1 change: 0 additions & 1 deletion addons/surgery/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class ACE_Medical_Treatment_Actions {
class BasicBandage;
class CheckPulse;
class ApplyTourniquet;
class ApplyTourniquet: BasicBandage {
condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo)) && ([ARR_2(_patient,_bodyPart)] call FUNC(hasAdditionalTourniquetAppliedTo)));
};
Expand Down
6 changes: 3 additions & 3 deletions addons/zeus/functions/fnc_ui_changeBloodType.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private _display = ctrlParent _control;
private _ctrlButtonOK = _display displayCtrl 1;
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);

_control ctrlRemoveAllEventHandlers "setFocus";
_control ctrlRemoveAllEventHandlers "SetFocus";


private _unit = attachedTo _logic;
Expand Down Expand Up @@ -118,5 +118,5 @@ private _fnc_onConfirm = {
_unit setVariable [QACEGVAR(medical,bloodvolume), ( parseNumber (_sliderValue toFixed 2)), true];
};

_display displayAddEventHandler ["unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm];
_display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];
6 changes: 3 additions & 3 deletions addons/zeus/functions/fnc_ui_changeCardiacState.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private _display = ctrlParent _control;
private _ctrlButtonOK = _display displayCtrl 1;
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);

_control ctrlRemoveAllEventHandlers "setFocus";
_control ctrlRemoveAllEventHandlers "SetFocus";


private _unit = attachedTo _logic;
Expand Down Expand Up @@ -78,5 +78,5 @@ private _fnc_onConfirm = {
};
};

_display displayAddEventHandler ["unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm];
_display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];
6 changes: 3 additions & 3 deletions addons/zeus/functions/fnc_ui_manageAirway.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private _display = ctrlParent _control;
private _ctrlButtonOK = _display displayCtrl 1;
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);

_control ctrlRemoveAllEventHandlers "setFocus";
_control ctrlRemoveAllEventHandlers "SetFocus";


private _unit = attachedTo _logic;
Expand Down Expand Up @@ -150,5 +150,5 @@ private _fnc_onConfirm = {
[_unit] call EFUNC(circulation,updateInternalBleeding);
};

_display displayAddEventHandler ["unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm];
_display displayAddEventHandler ["Unload", _fnc_onUnload];
_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm];

0 comments on commit d0e4502

Please sign in to comment.