mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
groundwork (replace items on heal order)
This commit is contained in:
parent
eee86a4bac
commit
62556d303b
@ -1,11 +0,0 @@
|
|||||||
|
|
||||||
class CfgWeapons {
|
|
||||||
// Remove items from Virtual Arsenal.
|
|
||||||
class ItemCore;
|
|
||||||
class FirstAidKit: ItemCore {
|
|
||||||
type = 0;
|
|
||||||
};
|
|
||||||
class Medikit: ItemCore {
|
|
||||||
type = 0;
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,4 +1,5 @@
|
|||||||
PREP(applyAnimAfterRagdoll);
|
PREP(applyAnimAfterRagdoll);
|
||||||
|
PREP(commandChanged);
|
||||||
PREP(damageBodyPart);
|
PREP(damageBodyPart);
|
||||||
PREP(disableThirdParty);
|
PREP(disableThirdParty);
|
||||||
PREP(getHitpointArmor);
|
PREP(getHitpointArmor);
|
||||||
|
@ -30,6 +30,11 @@
|
|||||||
};
|
};
|
||||||
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
|
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
|
||||||
|
|
||||||
|
if !("ace_medical_treatment" call EFUNC(common,isModLoaded)) then {
|
||||||
|
[TYPE_FIRST_AID_KIT, ""] call EFUNC(common,registerItemReplacement);
|
||||||
|
[TYPE_MEDIKIT, ""] call EFUNC(common,registerItemReplacement);
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
[QEGVAR(medical,woundReceived), {
|
[QEGVAR(medical,woundReceived), {
|
||||||
params ["_unit", "_damages", "_shooter", "_ammo"];
|
params ["_unit", "_damages", "_shooter", "_ammo"];
|
||||||
@ -38,7 +43,6 @@
|
|||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// this handles moving units into vehicles via load functions or zeus
|
// this handles moving units into vehicles via load functions or zeus
|
||||||
// needed, because the vanilla INCAPACITATED state does not handle vehicles
|
// needed, because the vanilla INCAPACITATED state does not handle vehicles
|
||||||
["CAManBase", "GetInMan", {
|
["CAManBase", "GetInMan", {
|
||||||
@ -96,3 +100,13 @@
|
|||||||
[_unit] call FUNC(unlockUnconsciousSeat);
|
[_unit] call FUNC(unlockUnconsciousSeat);
|
||||||
};
|
};
|
||||||
}, true, []] call CBA_fnc_addClassEventHandler;
|
}, true, []] call CBA_fnc_addClassEventHandler;
|
||||||
|
|
||||||
|
// Used for preventing vanilla heal by replacing items
|
||||||
|
addMissionEventHandler ["GroupCreated", {
|
||||||
|
params ["_group"];
|
||||||
|
_group addEventHandler ["CommandChanged", {_this call FUNC(commandChanged)}];
|
||||||
|
}];
|
||||||
|
|
||||||
|
{
|
||||||
|
_x addEventHandler ["CommandChanged", {_this call FUNC(commandChanged)}];
|
||||||
|
} forEach allGroups;
|
||||||
|
@ -27,6 +27,5 @@ class CfgPatches {
|
|||||||
#include "CfgFunctions.hpp"
|
#include "CfgFunctions.hpp"
|
||||||
#include "CfgMoves.hpp"
|
#include "CfgMoves.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "CfgWeapons.hpp"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
27
addons/medical_engine/functions/fnc_commandChanged.sqf
Normal file
27
addons/medical_engine/functions/fnc_commandChanged.sqf
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: LinkIsGrim
|
||||||
|
* Intercepts group heal attempts and replaces items
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [] call ace_medical_engine_fnc_commandChanged
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
params ["_group", "_newCommand"];
|
||||||
|
|
||||||
|
if (!local _group) exitWith {};
|
||||||
|
if !(_newCommand in ["HEAL", "HEAL SOLDIER", "PATCH SOLDIER", "FIRST AID", "HEAL SELF", "SUPPORT"]) exitWith {};
|
||||||
|
|
||||||
|
{
|
||||||
|
_x call EFUNC(common,replaceRegisteredItems);
|
||||||
|
if (!unitReady _x) then {
|
||||||
|
[_x] joinSilent (leader _group)
|
||||||
|
};
|
||||||
|
} forEach (units _group);
|
@ -36,7 +36,6 @@ if (isServer) then {
|
|||||||
// replace medical items with their ACE equivalents
|
// replace medical items with their ACE equivalents
|
||||||
["CBA_settingsInitialized", {
|
["CBA_settingsInitialized", {
|
||||||
TRACE_1("CBA_settingsInitialized EH",GVAR(convertItems)); // 0: Enabled 1: RemoveOnly 2:Disabled
|
TRACE_1("CBA_settingsInitialized EH",GVAR(convertItems)); // 0: Enabled 1: RemoveOnly 2:Disabled
|
||||||
if (GVAR(convertItems) == 2) exitWith {};
|
|
||||||
{
|
{
|
||||||
// turn [["stuff", 2], ...] into ["stuff", "stuff", ...]
|
// turn [["stuff", 2], ...] into ["stuff", "stuff", ...]
|
||||||
private _replacements = [];
|
private _replacements = [];
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
"LIST",
|
"LIST",
|
||||||
[LSTRING(ConvertItems_DisplayName), LSTRING(ConvertItems_Description)],
|
[LSTRING(ConvertItems_DisplayName), LSTRING(ConvertItems_Description)],
|
||||||
[ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)],
|
[ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)],
|
||||||
[[0, 1, 2], [ELSTRING(common,Enabled), LSTRING(ConvertItems_RemoveOnly), ELSTRING(common,Disabled)], 0],
|
[[0, 1], [ELSTRING(common,Enabled), LSTRING(ConvertItems_RemoveOnly)], 0],
|
||||||
true
|
true
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user