mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical Treatment - Fix grave digging (#9455)
This commit is contained in:
parent
3626b37c01
commit
3c9d7733e8
@ -153,7 +153,8 @@ private _objectClassesAddClassEH = call (uiNamespace getVariable [QGVAR(objectCl
|
|||||||
|
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
["ace_placedInBodyBag", {
|
["ace_placedInBodyBag", {
|
||||||
params ["_target", "_bodyBag"];
|
params ["_target", "_bodyBag", "_isGrave"];
|
||||||
|
if (_isGrave) exitWith {}; // assume graves aren't cargo
|
||||||
_bodyBag setVariable [QGVAR(customName), [_target, false, true] call EFUNC(common,getName), true];
|
_bodyBag setVariable [QGVAR(customName), [_target, false, true] call EFUNC(common,getName), true];
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,8 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
|
|||||||
|
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
["ace_placedInBodyBag", {
|
["ace_placedInBodyBag", {
|
||||||
params ["_target", "_bodyBag"];
|
params ["_target", "_bodyBag", "_isGrave"];
|
||||||
|
if (_isGrave) exitWith {};
|
||||||
TRACE_2("ace_placedInBodyBag eh",_target,_bodyBag);
|
TRACE_2("ace_placedInBodyBag eh",_target,_bodyBag);
|
||||||
|
|
||||||
private _dogTagData = [_target] call FUNC(getDogtagData);
|
private _dogTagData = [_target] call FUNC(getDogtagData);
|
||||||
|
Binary file not shown.
@ -31,7 +31,7 @@ class CfgVehicles {
|
|||||||
selection = "";
|
selection = "";
|
||||||
class GVAR(buryBodyBag) {
|
class GVAR(buryBodyBag) {
|
||||||
displayName = CSTRING(DigGrave);
|
displayName = CSTRING(DigGrave);
|
||||||
condition = QUOTE([_this#1] call FUNC(canDigGrave));
|
condition = QUOTE([ARR_2(_this#1, _this#0)] call FUNC(canDigGrave));
|
||||||
statement = QUOTE(_this call FUNC(placeBodyBagInGrave));
|
statement = QUOTE(_this call FUNC(placeBodyBagInGrave));
|
||||||
icon = QPATHTOEF(medical_gui,ui\grave.paa);
|
icon = QPATHTOEF(medical_gui,ui\grave.paa);
|
||||||
};
|
};
|
||||||
|
@ -47,6 +47,7 @@ PREP(loadUnit);
|
|||||||
PREP(medication);
|
PREP(medication);
|
||||||
PREP(medicationLocal);
|
PREP(medicationLocal);
|
||||||
PREP(onMedicationUsage);
|
PREP(onMedicationUsage);
|
||||||
|
PREP(placeBodyBagInGrave);
|
||||||
PREP(placeInBodyBag);
|
PREP(placeInBodyBag);
|
||||||
PREP(placeInBodyBagOrGrave);
|
PREP(placeInBodyBagOrGrave);
|
||||||
PREP(placeInGrave);
|
PREP(placeInGrave);
|
||||||
|
@ -84,6 +84,7 @@ if (["ace_trenches"] call EFUNC(common,isModLoaded)) then {
|
|||||||
["ace_placedInBodyBag", {
|
["ace_placedInBodyBag", {
|
||||||
params ["_target", "_restingPlace"];
|
params ["_target", "_restingPlace"];
|
||||||
TRACE_2("ace_placedInBodyBag eh",_target,_restingPlace);
|
TRACE_2("ace_placedInBodyBag eh",_target,_restingPlace);
|
||||||
|
if (isNull _restingPlace) exitWith {};
|
||||||
|
|
||||||
private _targetName = "";
|
private _targetName = "";
|
||||||
if (_target isKindOf "ACE_bodyBagObject") then {
|
if (_target isKindOf "ACE_bodyBagObject") then {
|
||||||
@ -92,6 +93,7 @@ if (["ace_trenches"] call EFUNC(common,isModLoaded)) then {
|
|||||||
_targetName = [_target, false, true] call EFUNC(common,getName);
|
_targetName = [_target, false, true] call EFUNC(common,getName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_targetName == "") exitWith {};
|
||||||
_restingPlace setVariable [QGVAR(headstoneData), _targetName, true];
|
_restingPlace setVariable [QGVAR(headstoneData), _targetName, true];
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Glowbal, esteldunedain
|
* Author: Glowbal, esteldunedain
|
||||||
* Handles cleaning up bodies that were replaced by body bags.
|
* Handles cleaning up bodies or body bags that were replaced by body bags or put in grave.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* None
|
* None
|
||||||
|
@ -16,15 +16,24 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_bodybag"];
|
params ["_bodybag", "_medic"];
|
||||||
TRACE_1("placeBodyBagInGrave",_bodybag);
|
TRACE_2("placeBodyBagInGrave",_bodybag,_medic);
|
||||||
|
|
||||||
[
|
[
|
||||||
QGVAR(treatmentTimeGrave),
|
GVAR(treatmentTimeGrave),
|
||||||
_this,
|
_this,
|
||||||
{
|
{
|
||||||
[[_this#1, _this#0], missionNameSpace getVariable [QGVAR(graveClassname), "ACE_Grave"], [0,0,0], missionNameSpace getVariable [QGVAR(graveRotation), 0]] call FUNC(placeInBodyBagOrGrave);
|
TRACE_1("finished",_this);
|
||||||
|
(_this#0) params ["_bodybag","_medic"];
|
||||||
|
private _graveClassname = "";
|
||||||
|
if (GVAR(graveDiggingMarker)) then {
|
||||||
|
_graveClassname = missionNamespace getVariable [QGVAR(graveClassname), "ACE_Grave"];
|
||||||
|
};
|
||||||
|
private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0];
|
||||||
|
|
||||||
|
[[_medic, _bodybag], _graveClassname, [0,0,0], _graveRotation, true] call FUNC(placeInBodyBagOrGrave);
|
||||||
},
|
},
|
||||||
{},
|
{TRACE_1("failed",_this);},
|
||||||
LLSTRING(DiggingGrave)
|
LLSTRING(DiggingGrave)
|
||||||
|
// ToDo: check FUNC(canDigGrave)? - what if body dragged/burried by someone else
|
||||||
] call EFUNC(common,progressBar);
|
] call EFUNC(common,progressBar);
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
* 1: Resting Place Classname <STRING>
|
* 1: Resting Place Classname <STRING>
|
||||||
* 2: Offset <ARRAY> (default: [0,0,0])
|
* 2: Offset <ARRAY> (default: [0,0,0])
|
||||||
* 3: Rotation <NUMBER> (default: 0)
|
* 3: Rotation <NUMBER> (default: 0)
|
||||||
|
* 4: Is Grave <BOOL> (default: false)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -20,16 +21,18 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_args", "_restingPlaceClass", ["_offset", [0,0,0]], ["_rotation", 0]];
|
params ["_args", "_restingPlaceClass", ["_offset", [0,0,0]], ["_rotation", 0], ["_isGrave", false]];
|
||||||
_args params ["_medic", "_patient"];
|
_args params ["_medic", "_patient"];
|
||||||
TRACE_1("placeInBodyBagOrGrave",_patient);
|
TRACE_1("placeInBodyBagOrGrave",_patient);
|
||||||
|
|
||||||
if (!local _patient) exitWith {
|
private _isHuman = _patient isKindOf "CaManBase";
|
||||||
|
|
||||||
|
if (_isHuman && {!local _patient}) exitWith {
|
||||||
TRACE_1("Calling where local",local _patient);
|
TRACE_1("Calling where local",local _patient);
|
||||||
[QGVAR(placeInBodyBagOrGrave), _this, _patient] call CBA_fnc_targetEvent;
|
[QGVAR(placeInBodyBagOrGrave), _this, _patient] call CBA_fnc_targetEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (alive _patient) then {
|
if (_isHuman && {alive _patient}) then {
|
||||||
TRACE_1("Manually killing with setDead",_patient);
|
TRACE_1("Manually killing with setDead",_patient);
|
||||||
[_patient, "buried_alive", _medic] call EFUNC(medical_status,setDead);
|
[_patient, "buried_alive", _medic] call EFUNC(medical_status,setDead);
|
||||||
};
|
};
|
||||||
@ -37,12 +40,12 @@ if (alive _patient) then {
|
|||||||
private _position = getPosASL _patient;
|
private _position = getPosASL _patient;
|
||||||
private _direction = 0;
|
private _direction = 0;
|
||||||
|
|
||||||
if (_patient isKindOf "CaManBase") then {
|
if (_isHuman) then {
|
||||||
private _headPos = _patient modelToWorldVisual (_patient selectionPosition "head");
|
private _headPos = _patient modelToWorldVisual (_patient selectionPosition "head");
|
||||||
private _spinePos = _patient modelToWorldVisual (_patient selectionPosition "Spine3");
|
private _spinePos = _patient modelToWorldVisual (_patient selectionPosition "Spine3");
|
||||||
_direction = (_headPos vectorFromTo _spinePos) call CBA_fnc_vectDir;
|
_direction = (_headPos vectorFromTo _spinePos) call CBA_fnc_vectDir;
|
||||||
} else {
|
} else {
|
||||||
_direction getDir _patient;
|
_direction = getDir _patient;
|
||||||
};
|
};
|
||||||
|
|
||||||
// apply adjustments
|
// apply adjustments
|
||||||
@ -54,17 +57,18 @@ _direction = _direction + _rotation;
|
|||||||
// This setPosASL seems to need to be called where the unit is local
|
// This setPosASL seems to need to be called where the unit is local
|
||||||
_patient setPosASL [-5000, -5000, 0];
|
_patient setPosASL [-5000, -5000, 0];
|
||||||
|
|
||||||
if (_restingPlaceClass == "") exitWith {
|
private _restingPlace = objNull;
|
||||||
[_patient, objNull]
|
if (_restingPlaceClass != "") then {
|
||||||
};
|
|
||||||
|
|
||||||
// Create the body bag object, set its position to prevent it from flipping
|
// Create the body bag object, set its position to prevent it from flipping
|
||||||
private _restingPlace = createVehicle [_restingPlaceClass, [0, 0, 0], [], 0, "NONE"];
|
_restingPlace = createVehicle [_restingPlaceClass, [0, 0, 0], [], 0, "NONE"];
|
||||||
_restingPlace setPosASL _position;
|
_restingPlace setPosASL _position;
|
||||||
_restingPlace setDir _direction;
|
_restingPlace setDir _direction;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Server will handle hiding and deleting the body
|
// Server will handle hiding and deleting the body
|
||||||
// Keep event name as body bag only to avoid breaking things for others
|
// Keep event name as body bag only to avoid breaking things for others
|
||||||
["ace_placedInBodyBag", [_patient, _restingPlace]] call CBA_fnc_globalEvent;
|
["ace_placedInBodyBag", [_patient, _restingPlace, _isGrave]] call CBA_fnc_globalEvent;
|
||||||
|
if (_isGrave) then {
|
||||||
[_patient, _restingPlace]
|
["ace_placedInGrave", [_patient, _restingPlace]] call CBA_fnc_globalEvent;
|
||||||
|
};
|
||||||
|
@ -29,6 +29,5 @@ if (GVAR(graveDiggingMarker)) then {
|
|||||||
};
|
};
|
||||||
private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0];
|
private _graveRotation = missionNameSpace getVariable [QGVAR(graveRotation), 0];
|
||||||
|
|
||||||
["ace_placedInGrave",
|
[_this, _graveClassname, [0,0,0], _graveRotation, true] call FUNC(placeInBodyBagOrGrave)
|
||||||
[_this, _graveClassname, [0,0,0], _graveRotation] call FUNC(placeInBodyBagOrGrave)
|
|
||||||
] call CBA_fnc_globalEvent;
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* However, player bodies cannot be deleted until they respawn, so it is hidden and deleted later.
|
* However, player bodies cannot be deleted until they respawn, so it is hidden and deleted later.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Body <OBJECT>
|
* 0: Body or Bodybag <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
|
@ -36,7 +36,7 @@ The vehicle events will also have the following local variables available `_gunn
|
|||||||
| Event Key | Parameters | Locality | Type | Description |
|
| Event Key | Parameters | Locality | Type | Description |
|
||||||
|----------|---------|---------|---------|---------|---------|
|
|----------|---------|---------|---------|---------|---------|
|
||||||
|`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed
|
|`ace_unconscious` | [_unit, _state(BOOL)] | Global | Listen | Unit's unconscious state changed
|
||||||
|`ace_placedInBodyBag` | [_target, _bodyBag] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted)
|
|`ace_placedInBodyBag` | [_target, _bodyBag, _isGrave] | Global | Listen | Target placed into a bodybag Note: (Target will soon be deleted, target could be a bodybag)
|
||||||
|`ace_placedInGrave` | [_target, _grave] | Global | Listen | Target placed into a grave, _grave will be objNull if `Create Grave Markers` is disabled Note: (Target will soon be deleted)
|
|`ace_placedInGrave` | [_target, _grave] | Global | Listen | Target placed into a grave, _grave will be objNull if `Create Grave Markers` is disabled Note: (Target will soon be deleted)
|
||||||
|`ace_treatmentStarted` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action has started (local on the _caller)
|
|`ace_treatmentStarted` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action has started (local on the _caller)
|
||||||
|`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller)
|
|`ace_treatmentSucceded` | [_caller, _target, _selectionName, _className, _itemUser, _usedItem] | Local | Listen | Treatment action is completed (local on the _caller)
|
||||||
|
Loading…
Reference in New Issue
Block a user