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

Fix blood draw bug #28

Merged
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
8 changes: 4 additions & 4 deletions addons/circulation/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ class ACE_Medical_Treatment_Actions {
displayName = CSTRING(DrawBlood500_Action_Use);
displayNameProgress = CSTRING(DrawBlood_Action_Progress);
treatmentTime = QGVAR(blood_drawTime_500ml);
allowedSelections[] = {"LeftArm", "RightArm"};
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = QGVAR(enable_selfBloodDraw);
category = "advanced";
medicRequired = 0;
consumeItem = 1;
callbackSuccess = QUOTE([ARR_3(_medic,_patient,500)] call FUNC(drawBlood));
condition = QUOTE([ARR_3(_medic,_patient,500)] call FUNC(canDraw));
condition = QUOTE([ARR_3(_medic,_patient,500)] call FUNC(canDraw) && (!(EGVAR(pharma,RequireInsIVBloodDraw)) || EFUNC(pharma,removeIV)));
items[] = {"KAT_Empty_bloodIV_500"};
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
Expand All @@ -51,13 +51,13 @@ class ACE_Medical_Treatment_Actions {
displayName = CSTRING(DrawBlood250_Action_Use);
displayNameProgress = CSTRING(DrawBlood_Action_Progress);
treatmentTime = QGVAR(blood_drawTime_250ml);
allowedSelections[] = {"LeftArm", "RightArm"};
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = QGVAR(enable_selfBloodDraw);
category = "advanced";
medicRequired = 0;
consumeItem = 1;
callbackSuccess = QUOTE([ARR_3(_medic,_patient,250)] call FUNC(drawBlood));
condition = QUOTE([ARR_3(_medic,_patient,250)] call FUNC(canDraw));
condition = QUOTE([ARR_3(_medic,_patient,250)] call FUNC(canDraw) && (!(EGVAR(pharma,RequireInsIVBloodDraw)) || EFUNC(pharma,removeIV)));
items[] = {"KAT_Empty_bloodIV_250"};
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
Expand Down
3 changes: 1 addition & 2 deletions addons/circulation/functions/fnc_canDraw.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ params ["_medic", "_patient", "_volume"];
private _bagItem = format ["ACE_bloodIV_%1", _volume];
private _bloodVolume = (_patient getVariable [QACEGVAR(medical,bloodVolume), 6.0]);
private _volumeChange = _volume/1000;
private _canAddItem = ((_medic canAddItemToUniform _bagItem) || (_medic canAddItemToVest _bagItem) || (_medic canAddItemToBackpack _bagItem)); // make sure the blood can actually be added to the medic, so you don't just lose blood
if (((_bloodVolume - _volumeChange) > GVAR(blood_draw_limit)) && _canAddItem) exitWith {true};
if (((_bloodVolume - _volumeChange) > GVAR(blood_draw_limit))) exitWith {true};
false
4 changes: 2 additions & 2 deletions addons/circulation/functions/fnc_drawBlood.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* None
*
* Example:
* [medic, medic, 500] call kat_circulation_fnc_drawBlood;
* [medic, patient, 500] call kat_circulation_fnc_drawBlood;
*
* Public: No
*/
Expand All @@ -31,5 +31,5 @@ if (GVAR(bloodGroups)) then {
_bloodtypeStr = format ["_%1",_bloodtype];
};
private _itemStr = format ["%1bloodIV%2%3",_modStr,_bloodtypeStr,_bagVolumeStr];
_medic addItem _itemStr;
[_medic, _itemStr] call ACEFUNC(common,addToInventory);
_patient setVariable [QACEGVAR(medical,bloodVolume), _bloodVolume - _volumeChange,true];
9 changes: 9 additions & 0 deletions addons/pharma/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ PREP_RECOMPILE_END;
true
] call CBA_Settings_fnc_init;

[
QGVAR(RequireInsIVBloodDraw),
"CHECKBOX",
[LLSTRING(SETTING_REQUIRE_INS_IV_BLOOD_DRAW),LLSTRING(SETTING_REQUIRE_INS_IV_BLOOD_DRAW_DESC)],
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)],
[false],
true
] call CBA_Settings_fnc_init;

[
QGVAR(IVdropEnable),
"CHECKBOX",
Expand Down
23 changes: 8 additions & 15 deletions addons/pharma/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,21 +1055,8 @@
<Finnish>%1 ei ole tyhjä</Finnish>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_REQUIRE_INS_IV">
<English>Require inserted IV/IO</English>
<German>Erfordert eingefügtes IV/IO</German>
<Polish>Wymagaj włożonego IV/IO</Polish>
<French>IV/IO posée requise</French>
<Chinese>需要插入 IV/IO</Chinese>
<Chinesesimp>需要建立 IV/IO</Chinesesimp>
<Italian>Richiesto inserimento IV/IO</Italian>
<Spanish>Requerir una IV/IO</Spanish>
<Korean>삽입된 IV/IO 필요</Korean>
<Turkish>Takılı IV/IO gerektir</Turkish>
<Czech>Vyžadování vložení IV/IO</Czech>
<Japanese>輸液にIV/IO刺入を要求する</Japanese>
<Russian>Требовать вставки IV/IO</Russian>
<Portuguese>Requerer inserção de IV/IO</Portuguese>
<Finnish>Vaadi lisätty IV/IO</Finnish>
<English>Fluid Require inserted IV/IO</English>
<German>Flüssigkeiten Erfordert eingefügtes IV/IO</German>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_REQUIRE_INS_IV_DESC">
<English>Default false. If true, you will need to insert IV/IO first before being able to give someone saline/blood/plasma. \nIf false, it retains standard ACE behaviour for using saline/blood/plasma.</English>
Expand Down Expand Up @@ -1116,6 +1103,12 @@
<Portuguese>Falso, por padrão. Se verdadeiro, você precisará inserir IV/IO primeiro antes de poder administrar medicamentos a alguém. \nSe falso, você pode administrá-los sem ele.</Portuguese>
<Finnish>Oletusarvo epätosi. Jos totta, sinun on lisättävä IV/IO ensin, ennen kuin voit antaa jollekin lääkkeitä. \nJos vääriä, voit antaa ne ilman sitä.</Finnish>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_REQUIRE_INS_IV_BLOOD_DRAW">
<English>Blood Drawing Require IV/IO</English>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_REQUIRE_INS_IV_BLOOD_DRAW_DESC">
<English>Default false. If true, you will need to insert IV/IO first before being able to draw blood from someone. \nIf false, you can draw without it.</English>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_Reorientation_Slap">
<English>Reorientation slap sound</English>
<Polish>Dźwięk przy cuceniu</Polish>
Expand Down
Loading