Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical - Add condition for surgicial kit #6916

Merged
merged 5 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class GVAR(Actions) {
allowSelfTreatment = 0;
requiredMedic = QEGVAR(medical,medicSetting_SurgicalKit);
treatmentTime = QUOTE(count (_target getVariable [ARR_2('EGVAR(medical,bandagedWounds)',[])]) * 5);
condition = QFUNC(canStitch);
callbackSuccess = "";
callbackProgress = QFUNC(treatmentSurgicalKit_onProgress);
itemConsumed = QEGVAR(medical,consumeItem_SurgicalKit);
Expand Down
1 change: 1 addition & 0 deletions addons/medical_treatment/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ PREP(bodyCleanupLoop);
PREP(calculateBlood);
PREP(canAccessMedicalEquipment);
PREP(canBandage);
PREP(canStitch);
PREP(findMostEffectiveWound);
PREP(getBandageTime);
PREP(getTriageStatus);
Expand Down
3 changes: 3 additions & 0 deletions addons/medical_treatment/functions/fnc_canBandage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* ReturnValue:
* Can Bandage <BOOL>
*
* Example:
* [player, cursorTarget, "Head", "FieldDressing"] call ace_medical_treatment_fnc_canBandage
*
* Public: No
*/

Expand Down
21 changes: 21 additions & 0 deletions addons/medical_treatment/functions/fnc_canStitch.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "script_component.hpp"
/*
* Author: Katalam
* Prevents stitch actions from showing if the body is either fully stitched or has no open wounds.
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* ReturnValue:
* Can Stitch <BOOL>
*
* Example:
* [player, cursorTarget] call ace_medical_treatment_fnc_canStitch
*
* Public: No
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example is missing. Each header has to follow the same rules. For example: https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_canDig.sqf


params ["", "_patient"];

!((_patient getVariable [QEGVAR(medical,bandagedWounds), []]) isEqualTo [])