mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Minor code refactor
This commit is contained in:
parent
8d34f98909
commit
95cfe5ce3a
@ -148,6 +148,7 @@ PREP(moduleBasicRevive);
|
||||
PREP(setWeaponsCorrectUnconscious);
|
||||
PREP(setCaptiveSwitch);
|
||||
|
||||
|
||||
// initalize all module parameters.
|
||||
GVAR(setting_allowInstantDead) = true;
|
||||
GVAR(setting_AdvancedLevel) = 0;
|
||||
|
@ -42,11 +42,11 @@ if (!alive _unit) exitwith {
|
||||
[_caller, false] call FUNC(treatmentMutex);
|
||||
[{
|
||||
_this call FUNC(actionCarryUnit);
|
||||
}, [_caller, ([_unit,_caller] call EFUNC(medical,makeCopyOfBody_F)), _killOnDrop], 0.2, 0.2] call EFUNC(common,waitAndExecute);
|
||||
}, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
|
||||
if !([_caller,_unit] call EFUNC(common,carryObj)) exitwith {
|
||||
["couldn't carry object!"] call EFUNC(common,debug); [_caller,"release"] call FUNC(treatmentMutex);
|
||||
["couldn't carry object!"] call EFUNC(common,debug); [_caller,false] call FUNC(treatmentMutex);
|
||||
};
|
||||
|
||||
if (primaryWeapon _caller == "") then {
|
||||
|
@ -40,7 +40,7 @@ if (!alive _unit) exitwith {
|
||||
[_caller, false] call FUNC(treatmentMutex);
|
||||
[{
|
||||
_this call FUNC(actionDragUnit);
|
||||
}, [_caller, ([_unit,_caller] call EFUNC(medical,makeCopyOfBody_F)), _killOnDrop], 0.2, 0.2] call EFUNC(common,waitAndExecute);
|
||||
}, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
|
||||
if (primaryWeapon _caller == "") then {
|
||||
@ -66,7 +66,6 @@ if (currentWeapon _caller == primaryWeapon _caller) then {
|
||||
[_caller,"AcinPknlMstpSnonWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
|
||||
_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
|
||||
[2,
|
||||
{((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1.5))}, // the condition
|
||||
|
@ -15,7 +15,7 @@ _oldBody = _this select 0;
|
||||
_caller = _this select 1;
|
||||
|
||||
if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies
|
||||
_name = _oldBody getvariable [QGVAR(name),"unknown"];
|
||||
_name = _oldBody getvariable ["ACE_name","unknown"];
|
||||
_class = typeof _oldBody;
|
||||
_side = side _caller;
|
||||
_group = createGroup _side;
|
||||
@ -28,7 +28,7 @@ _caller = _this select 1;
|
||||
{
|
||||
[_newUnit,_x select 0, _x select 2] call EFUNC(common,setDefinedVariable);
|
||||
}foreach _allVariables;
|
||||
_newUnit setVariable [QGVAR(name),_name,true];
|
||||
_newUnit setVariable ["ACE_name",_name,true];
|
||||
|
||||
_newUnit disableAI "TARGET";
|
||||
_newUnit disableAI "AUTOTARGET";
|
||||
|
Loading…
Reference in New Issue
Block a user