Add new unit_setFractures function to handle better broken bones

- Removes old object_setHit
- Double checks if global broken bone variables are properly set after changing clothes.
- This should finally fix broken bones after changing clothes.
This commit is contained in:
A Man
2022-06-03 20:48:52 +02:00
parent d9f41afd19
commit 56787c71a0
5 changed files with 32 additions and 23 deletions

View File

@@ -1,17 +1,11 @@
private ["_msg","_unit","_medic","_item"];
local _unit = _this select 0;
local _medic = _this select 1;
local _item = _this select 2;
local _displayName = getText(configFile >> "CfgMagazines" >> _item >> "displayName");
_unit = _this select 0;
_medic = _this select 1;
_item = _this select 2;
r_fracture_legs = false;
r_fracture_arms = false;
_unit setHit["legs",0];
_unit setHit["hands",0];
_unit setVariable ["hit_legs",0,true];
_unit setVariable ["hit_hands",0,true];
[_unit,"legs",0,false,false] call unit_setFractures;
[_unit,"hands",0,false,false] call unit_setFractures;
if (_medic != player) then {
_msg = if (_item == "equip_woodensplint") then {"STR_ITEM_NAME_WOODENSPLINT"} else {"STR_EQUIP_NAME_15"};
format [localize "str_actions_medical_general_received",(name _medic), localize _msg] call dayz_rollingMessages;
};
format [localize "str_actions_medical_general_received",(name _medic),_displayName] call dayz_rollingMessages;
};