Merge branch 'master' into explosiveInteraction

This commit is contained in:
Garth L-H de Wet 2015-02-21 13:17:08 +02:00
commit 2ad0aab2bb
60 changed files with 271 additions and 524 deletions

View File

@ -19,22 +19,10 @@
PARAMS_1(_unit); PARAMS_1(_unit);
DEFAULT_PARAM(1,_target,objNull); DEFAULT_PARAM(1,_target,objNull);
private ["_isAttached"];
if (isNull _target) then { if (isNull _target) then {
_target = _unit getVariable [QGVAR(escortedUnit), objNull]; _target = _unit getVariable [QGVAR(escortedUnit), objNull];
}; };
if (isNull _target) exitWith { if (isNull _target) exitWith {false};
ERROR("Null Target (no ACE_escortedUnit)");
false
};
_isAttached = _target in (attachedObjects _unit); (_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}
if (_isAttached && (!(_target getVariable [QGVAR(isHandcuffed), false]))) exitWith {
ERROR("Attached But Not Captive");
false
};
_isAttached

View File

@ -38,7 +38,7 @@ class Extended_Respawn_EventHandlers {
respawn = QUOTE(_this call FUNC(setName)); respawn = QUOTE(_this call FUNC(setName));
}; };
class GVAR(RESETDefaults) { class GVAR(RESETDefaults) {
respawn = QUOTE(_this call FUNC(resetAllDefaults_F)); respawn = QUOTE(_this call FUNC(resetAllDefaults));
}; };
}; };
}; };

View File

@ -15,12 +15,16 @@ PREP(addSetting);
PREP(adminKick); PREP(adminKick);
PREP(ambientBrightness); PREP(ambientBrightness);
PREP(applyForceWalkStatus); PREP(applyForceWalkStatus);
PREP(beingCarried);
PREP(binarizeNumber); PREP(binarizeNumber);
PREP(callCustomEventHandlers); PREP(callCustomEventHandlers);
PREP(callCustomEventHandlersGlobal); PREP(callCustomEventHandlersGlobal);
PREP(canGetInPosition); PREP(canGetInPosition);
PREP(canInteract);
PREP(canInteractWith); PREP(canInteractWith);
PREP(canUseWeapon); PREP(canUseWeapon);
PREP(carriedByObj);
PREP(carryObj);
PREP(changeProjectileDirection); PREP(changeProjectileDirection);
PREP(checkPBOs); PREP(checkPBOs);
PREP(claim); PREP(claim);
@ -30,6 +34,10 @@ PREP(codeToString);
PREP(convertKeyCode); PREP(convertKeyCode);
PREP(createOrthonormalReference); PREP(createOrthonormalReference);
PREP(currentChannel); PREP(currentChannel);
PREP(debug);
PREP(debugModule);
PREP(defineVariable);
PREP(disableAI);
PREP(disableUserInput); PREP(disableUserInput);
PREP(displayText); PREP(displayText);
PREP(displayTextPicture); PREP(displayTextPicture);
@ -42,12 +50,21 @@ PREP(execRemoteFnc);
PREP(executePersistent); PREP(executePersistent);
PREP(filter); PREP(filter);
PREP(fixLoweredRifleAnimation); PREP(fixLoweredRifleAnimation);
PREP(getAllDefinedSetVariables);
PREP(getAllGear); PREP(getAllGear);
PREP(getCaptivityStatus); PREP(getCaptivityStatus);
PREP(getCarriedBy);
PREP(getCarriedObj);
PREP(getConfigCommander); PREP(getConfigCommander);
PREP(getConfigGunner); PREP(getConfigGunner);
PREP(getDeathAnim);
PREP(getDefaultAnim); PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getDoorTurrets); PREP(getDoorTurrets);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus); PREP(getForceWalkStatus);
PREP(getGunner); PREP(getGunner);
PREP(getHitPoints); PREP(getHitPoints);
@ -56,6 +73,7 @@ PREP(getInPosition);
PREP(getMarkerType); PREP(getMarkerType);
PREP(getName); PREP(getName);
PREP(getNumberFromMissionSQM); PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn);
PREP(getPitchBankYaw); PREP(getPitchBankYaw);
PREP(getSettingData); PREP(getSettingData);
PREP(getStringFromMissionSQM); PREP(getStringFromMissionSQM);
@ -74,29 +92,43 @@ PREP(getUavControlPosition);
PREP(getVehicleCargo); PREP(getVehicleCargo);
PREP(getVehicleCodriver); PREP(getVehicleCodriver);
PREP(getVehicleCrew); PREP(getVehicleCrew);
PREP(getVersion);
PREP(getWeaponAzimuthAndInclination); PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex); PREP(getWeaponIndex);
PREP(getWeaponType); PREP(getWeaponType);
PREP(getWindDirection); PREP(getWindDirection);
PREP(goKneeling); PREP(goKneeling);
PREP(hadamardProduct); PREP(hadamardProduct);
PREP(hasItem);
PREP(hasMagazine);
PREP(inheritsFrom);
PREP(insertionSort);
PREP(interpolateFromArray); PREP(interpolateFromArray);
PREP(inTransitionAnim); PREP(inTransitionAnim);
PREP(inWater);
PREP(isArrested);
PREP(isAutoWind); PREP(isAutoWind);
PREP(isAwake);
PREP(isEngineer); PREP(isEngineer);
PREP(isEOD); PREP(isEOD);
PREP(isInBuilding); PREP(isInBuilding);
PREP(isModLoaded);
PREP(isPlayer); PREP(isPlayer);
PREP(isTurnedOut); PREP(isTurnedOut);
PREP(letterToCode); PREP(letterToCode);
PREP(limitMovementSpeed);
PREP(loadPerson);
PREP(loadPersonLocal);
PREP(loadSettingsFromProfile); PREP(loadSettingsFromProfile);
PREP(loadSettingsOnServer); PREP(loadSettingsOnServer);
PREP(map); PREP(map);
PREP(moduleCheckPBOs); PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles); PREP(moduleLSDVehicles);
PREP(moveToTempGroup);
PREP(muteUnit); PREP(muteUnit);
PREP(numberToDigits); PREP(numberToDigits);
PREP(numberToDigitsString); PREP(numberToDigitsString);
PREP(onAnswerRequest);
PREP(onLoadRscDisplayChannel); PREP(onLoadRscDisplayChannel);
PREP(owned); PREP(owned);
PREP(player); PREP(player);
@ -104,33 +136,53 @@ PREP(playerSide);
PREP(progressBar); PREP(progressBar);
PREP(queueAnimation); PREP(queueAnimation);
PREP(readSettingFromModule); PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler); PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler); PREP(removeActionMenuEventHandler);
PREP(removeCameraEventHandler); PREP(removeCameraEventHandler);
PREP(removeCustomEventHandler); PREP(removeCustomEventHandler);
PREP(removeMapMarkerCreatedEventHandler); PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler); PREP(removeScrollWheelEventHandler);
PREP(requestCallback);
PREP(resetAllDefaults);
PREP(restoreVariablesJIP); PREP(restoreVariablesJIP);
PREP(revertKeyCodeLocalized); PREP(revertKeyCodeLocalized);
PREP(sanitizeString); PREP(sanitizeString);
PREP(sendRequest);
PREP(serverLog); PREP(serverLog);
PREP(setArrestState);
PREP(setCanInteract);
PREP(setCaptivityStatus); PREP(setCaptivityStatus);
PREP(setCarriedBy);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus); PREP(setForceWalkStatus);
PREP(setHearingCapability);
PREP(setName); PREP(setName);
PREP(setParameter); PREP(setParameter);
PREP(setPitchBankYaw); PREP(setPitchBankYaw);
PREP(setVariableJIP); PREP(setProne);
PREP(setVariablePublic);
PREP(setSetting); PREP(setSetting);
PREP(setSettingFromConfig); PREP(setSettingFromConfig);
PREP(setVariableJIP);
PREP(setVariablePublic);
PREP(setVolume);
PREP(sortAlphabeticallyBy);
PREP(stringCompare);
PREP(stringToColoredText); PREP(stringToColoredText);
PREP(stringRemoveWhiteSpace);
PREP(subString); PREP(subString);
PREP(switchToGroupSide);
PREP(throttledPublicVariable);
PREP(toBin); PREP(toBin);
PREP(toBitmask); PREP(toBitmask);
PREP(toHex); PREP(toHex);
PREP(toNumber); PREP(toNumber);
PREP(throttledPublicVariable); PREP(uniqueElementsOnly);
PREP(unloadPerson);
PREP(unmuteUnit); PREP(unmuteUnit);
PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute); PREP(waitAndExecute);
// ACE_Debug // ACE_Debug
@ -195,74 +247,6 @@ if (hasInterface) then {
}, 0, []] call cba_fnc_addPerFrameHandler; }, 0, []] call cba_fnc_addPerFrameHandler;
}; };
PREP(stringCompare);
PREP(string_removeWhiteSpace);
PREP(isHC);
PREP(sendRequest_f);
PREP(requestCallback);
PREP(receiveRequest);
PREP(onAnswerRequest);
PREP(debug);
PREP(debugModule);
PREP(defineVariable);
PREP(setDefinedVariable);
PREP(getDefinedVariable);
PREP(getAllDefinedSetVariables);
PREP(getDefinedVariableInfo);
PREP(getDefinedVariableDefault);
PREP(getDeathAnim);
PREP(insertionSort);
PREP(uniqueElementsOnly);
PREP(sortAlphabeticallyBy);
PREP(hasMagazine);
PREP(useMagazine);
PREP(findMagazine);
PREP(hasItem);
PREP(useItem);
PREP(findItem);
PREP(getNumberMagazinesIn);
PREP(setCanInteract);
PREP(getCanInteract);
PREP(canInteract);
PREP(resetAllDefaults_f);
PREP(broadcastSound3D_f);
PREP(isAwake);
PREP(setProne);
PREP(setDisableUserInputStatus);
PREP(dropWeapon_f);
PREP(inWater_f);
PREP(setVolume_f);
PREP(closeAllDialogs_f);
PREP(disableAI_f);
PREP(switchToGroupSide_f);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(setHearingCapability);
PREP(revealObject_f);
PREP(getWeaponItems_f);
PREP(isModLoaded_f);
PREP(inheritsFrom);
PREP(getVersion);
PREP(carryObj);
PREP(carriedByObj);
PREP(getCarriedObj);
PREP(getCarriedBy);
PREP(beingCarried);
PREP(setCarriedBy);
PREP(moveToTempGroup);
PREP(limitMovementSpeed);
PREP(setArrestState);
PREP(isArrested);
PREP(loadPerson_F);
PREP(loadPersonLocal_F);
PREP(unloadPerson_F);
ADDON = true; ADDON = true;
isHC = !(hasInterface || isDedicated);

View File

@ -1,16 +0,0 @@
/**
* fn_broadcastSound3D_f.sqf
* @Descr: Plays a sound in 3D
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, sound STRING]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
if (isDedicated) exitwith{};
_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
_sound = [_this, 1, "",[""]] call BIS_fnc_Param;
_unit say3D _sound;

View File

@ -1,14 +0,0 @@
/**
* fn_closeAllDialogs_f.sqf
* @Descr: Close all dialogs
* @Author: Glowbal
*
* @Arguments: []
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
while {dialog} do {
closeDialog 0;
};

View File

@ -1,39 +0,0 @@
/**
* fn_dropWeapon_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
private ["_unit","_currentWeapon","_currentAnimation", "_WeaponHolder"];
_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
_currentWeapon = currentWeapon _unit;
_currentAnimation = animationState _unit;
_WeaponHolder = "GroundWeaponHolder" createVehicle position _unit;
_unit removeWeapon _currentWeapon;
_weaponHolder addWeaponCargoGlobal [_currentWeapon, 1];
//_unit action [ "DropWeapon", _WeaponHolder, _currentWeapon ];
_WeaponHolder setPos (getPos _unit);
//_unit switchMove _currentAnimation;
_primairyWeapon = primaryWeapon _unit;
_secondairyWeapon = secondaryWeapon _unit;
_handGunWeapon = handgunWeapon _unit;
switch (_currentWeapon) do {
case _primairyWeapon: {
};
case _secondairyWeapon: {
};
case _handGunWeapon: {
};
default {};
};

View File

@ -1,25 +0,0 @@
/**
* fn_findItem.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_magazine","_return"];
_unit = _this select 0;
_item = _this select 1;
if (_item in (uniformItems _unit)) exitwith {1};
if (_item in (vestItems _unit)) exitwith {2};
if (_item in (backpackItems _unit)) exitwith {3};
if (_item in (assignedItems _unit)) exitwith {4};
if (_item in (primaryWeaponItems _unit)) exitwith {5};
if (_item in (secondaryWeaponItems _unit)) exitwith {6};
if (_item in (handgunItems _unit)) exitwith {7};
if (_item in (items _unit)) exitwith {8}; // in case it is in items but cannot be found in any other container (should never reach this)
// If we cannot find the item, return 0.
0;

View File

@ -1,21 +0,0 @@
/**
* fn_findMagazine.sqf
* @Descr: Find where the current magazines are. Order: uniform, vest, backpack, any.
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, magazine STRING (Classname of magazine)]
* @Return: NUMBER 0 = none, 1 = in uniform, 2 = in vest, 3 = in backpack, 4 = found outside container
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_unit","_magazine"];
_unit = _this select 0;
_magazine = _this select 1;
if (_magazine in (getMagazineCargo uniformContainer _unit)) exitwith {1};
if (_magazine in (getMagazineCargo vestContainer _unit)) exitwith {2};
if (_magazine in (getMagazineCargo backpackContainer _unit)) exitwith {3};
if (_magazine in (magazines _unit)) exitwith {4}; // in case it cannot be found in any other container. Most likely loaded in a weapon.
// If we cannot find the item, return 0.
0;

View File

@ -1,12 +0,0 @@
/**
* fn_getCanInteract.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
((_this select 0) getvariable [QGVAR(canInteract),0])

View File

@ -1,45 +0,0 @@
/**
* fn_getCustomResults_f.sqf
* @Descr: Executes custom results eventhandlers, collects their output and returns this.
* @Author: Glowbal
*
* @Arguments: [arguments ANY, handle STRING]
* @Return: ARRAY Collection of all return values of all executed CustomResult handlers
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"];
_arguments = _this select 0;
_handle = _this select 1;
_eventHandlerName = ("ace_f_custom_results_eventhandler_" + _handle);
_eventHandlerCollection = missionNamespace getvariable _eventHandlerName;
if (isnil "_eventHandlerCollection") then {
_eventHandlerCollection = [];
// TODO Get a replacement for this
_cfg = (ConfigFile >> "Advanced_Combat_Environment" >> "CustomResults" >> _handle);
if (isClass _cfg) then {
_numberOfEH = count _cfg;
for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do {
_ehCfg = _cfg select _EHiterator;
if (isClass _ehCfg) then {
_classType = (ConfigName _ehCfg);
_code = (compile getText(_ehCfg >> "onCall"));
_eventHandlerCollection pushback [_classType, _code];
true;
};
};
};
missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection];
};
_return = [];
{
_return pushback (_arguments call (_x select 1));
false;
}count _eventHandlerCollection;
_return

View File

@ -1,14 +0,0 @@
/**
* fn_getWeaponItems_f.sqf
* @Descr: Get the weapon items from the unit.
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
[primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit];

View File

@ -1,24 +0,0 @@
/**
* fn_isHC.sqf
* @Descr: Check if current locality is a headless client
* @Author: Glowbal
*
* @Arguments: []
* @Return: BOOL True if locality is headless client OR is not in multiplayer
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_return"];
if (!isMultiplayer) then {
_return = true;
} else {
if (isServer && !isDedicated) then {
_return = true;
} else {
_return = !(hasInterface || isDedicated);
};
};
_return

View File

@ -10,7 +10,7 @@
#include "script_component.hpp" #include "script_component.hpp"
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F)) #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson))
private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank"]; private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank"];
_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; _caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
@ -34,9 +34,9 @@ if (_unit distance _loadcar <= 10) then {
}; };
}; };
if (!isNull _vehicle) then { if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
[_caller,objNull] call FUNC(carryObj); [_caller,objNull] call FUNC(carryObj);
[_unit,objNull] call FUNC(carryObj); [_unit,objNull] call FUNC(carryObj);
[[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal_F)), _unit, false] call EFUNC(common,execRemoteFnc); [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc);
}; };
_vehicle _vehicle

View File

@ -16,13 +16,13 @@ _vehicle = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param;
_caller = [_this, 2, ObjNull,[ObjNull]] call BIS_fnc_Param; _caller = [_this, 2, ObjNull,[ObjNull]] call BIS_fnc_Param;
if (!alive _unit) then { if (!alive _unit) then {
_unit = [_unit,_caller] call FUNC(makeCopyOfBody_F); _unit = [_unit,_caller] call FUNC(makeCopyOfBody);
}; };
_unit moveInCargo _vehicle; _unit moveInCargo _vehicle;
_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]];
_loaded pushback _unit; _loaded pushback _unit;
_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; _vehicle setvariable [QGVAR(loaded_persons),_loaded,true];
if (!([_unit] call FUNC(isAwake))) then { if (!([_unit] call FUNC(isAwake))) then {
_handle = [_unit,_vehicle] spawn { _handle = [_unit,_vehicle] spawn {
private ["_unit","_vehicle"]; private ["_unit","_vehicle"];

View File

@ -18,12 +18,12 @@ if (_moveTo) then {
_previousGroup = group _unit; _previousGroup = group _unit;
_newGroup = createGroup (side _previousGroup); _newGroup = createGroup (side _previousGroup);
[_unit] joinSilent _newGroup; [_unit] joinSilent _newGroup;
_unit setvariable [QGVAR(previousGroup_F),_previousGroup]; _unit setvariable [QGVAR(previousGroup),_previousGroup];
} else { } else {
_previousGroup = _unit getvariable QGVAR(previousGroup_F); _previousGroup = _unit getvariable QGVAR(previousGroup);
if (!isnil "_previousGroup") then { if (!isnil "_previousGroup") then {
_currentGroup = group _unit; _currentGroup = group _unit;
_unit setvariable [QGVAR(previousGroup_F),nil]; _unit setvariable [QGVAR(previousGroup),nil];
[_unit] joinSilent _previousGroup; [_unit] joinSilent _previousGroup;
if (count units _currentGroup == 0) then { if (count units _currentGroup == 0) then {
deleteGroup _currentGroup; deleteGroup _currentGroup;

View File

@ -17,17 +17,17 @@ _unit setvariable ["ACE_isDead",nil,true];
_unit setvariable ["ACE_isUnconscious", nil, true]; _unit setvariable ["ACE_isUnconscious", nil, true];
if (isPlayer _unit) then { if (isPlayer _unit) then {
[true] call FUNC(setVolume_f); [true] call FUNC(setVolume);
[false] call FUNC(disableKeyInput_f); [false] call FUNC(disableKeyInput);
if (["ace_medical"] call FUNC(isModLoader_f)) then { if (["ace_medical"] call FUNC(isModLoader)) then {
[false] call EFUNC(medical,effectBlackOut); [false] call EFUNC(medical,effectBlackOut);
}; };
if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
// clear all disable user input // clear all disable user input
{ {
[_X, false] call FUNC(setDisableUserInputStatus); [_X, false] call FUNC(setDisableUserInputStatus);
}foreach GVAR(DISABLE_USER_INPUT_COLLECTION_F); }foreach GVAR(DISABLE_USER_INPUT_COLLECTION);
}; };
}; };

View File

@ -1,15 +0,0 @@
/**
* fnc_revealObject_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
if (hasInterface) then {
player reveal (_this select 0);
};

View File

@ -13,16 +13,16 @@ _id = _this select 0;
_disable = _this select 1; _disable = _this select 1;
if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
GVAR(DISABLE_USER_INPUT_COLLECTION_F) = []; GVAR(DISABLE_USER_INPUT_COLLECTION) = [];
}; };
if (_disable) then { if (_disable) then {
GVAR(DISABLE_USER_INPUT_COLLECTION_F) pushback _id; GVAR(DISABLE_USER_INPUT_COLLECTION) pushback _id;
[true] call FUNC(disableUserInput); [true] call FUNC(disableUserInput);
} else { } else {
GVAR(DISABLE_USER_INPUT_COLLECTION_F) = GVAR(DISABLE_USER_INPUT_COLLECTION_F) - [_id]; GVAR(DISABLE_USER_INPUT_COLLECTION) = GVAR(DISABLE_USER_INPUT_COLLECTION) - [_id];
if (GVAR(DISABLE_USER_INPUT_COLLECTION_F) isEqualTo []) then { if (GVAR(DISABLE_USER_INPUT_COLLECTION) isEqualTo []) then {
[false] call FUNC(disableUserInput); [false] call FUNC(disableUserInput);
}; };
}; };

View File

@ -16,7 +16,7 @@ _switch = [_this, 1, false,[false]] call BIS_fnc_Param;
_id = [_this, 2, "", [""]] call BIS_fnc_Param; _id = [_this, 2, "", [""]] call BIS_fnc_Param;
_side = [_this, 3, side _unit,[west]] call BIS_fnc_Param; _side = [_this, 3, side _unit,[west]] call BIS_fnc_Param;
_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo_F),[]]; _previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo),[]];
if (_switch) then { if (_switch) then {
// go forward // go forward
_previousGroup = group _unit; _previousGroup = group _unit;
@ -30,7 +30,7 @@ if (_switch) then {
[_unit] joinSilent _newGroup; [_unit] joinSilent _newGroup;
_previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; _previousGroupsList pushback [_previousGroup, _originalSide, _id, true];
_unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; _unit setvariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true];
} else { } else {
// go one back // go one back
{ {
@ -60,5 +60,5 @@ if (_switch) then {
}foreach _previousGroupsList; }foreach _previousGroupsList;
_previousGroupsList = _previousGroupsList - [objNull]; _previousGroupsList = _previousGroupsList - [objNull];
reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order.
_unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; _unit setvariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true];
}; };

View File

@ -10,7 +10,7 @@
#include "script_component.hpp" #include "script_component.hpp"
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F)) #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson))
private ["_caller", "_unit","_vehicle", "_loaded"]; private ["_caller", "_unit","_vehicle", "_loaded"];
_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; _caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param;
@ -27,11 +27,11 @@ if (!alive _unit) then {
_unit action ["Eject", vehicle _unit]; _unit action ["Eject", vehicle _unit];
}; };
[_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); [_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]];
_loaded = _loaded - [_unit]; _loaded = _loaded - [_unit];
_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; _vehicle setvariable [QGVAR(loaded_persons),_loaded,true];
if (!([_unit] call FUNC(isAwake))) then { if (!([_unit] call FUNC(isAwake))) then {
_handle = [_unit,_vehicle] spawn { _handle = [_unit,_vehicle] spawn {

View File

@ -50,8 +50,8 @@ call FUNC(handleDisplayEffects);
["onUnconscious", FUNC(onUnconscious)] call ace_common_fnc_addEventHandler; ["onUnconscious", FUNC(onUnconscious)] call ace_common_fnc_addEventHandler;
["carryObjectDropped", FUNC(onCarryObjectDropped)] call ace_common_fnc_addEventHandler; ["carryObjectDropped", FUNC(onCarryObjectDropped)] call ace_common_fnc_addEventHandler;
if (isNil QGVAR(ENABLE_REVIVE_F)) then { if (isNil QGVAR(ENABLE_REVIVE)) then {
GVAR(ENABLE_REVIVE_F) = 0; GVAR(ENABLE_REVIVE) = 0;
}; };

View File

@ -141,8 +141,8 @@ PREP(setUnconsciousState);
PREP(isUnconscious); PREP(isUnconscious);
PREP(getUnconsciousCondition); PREP(getUnconsciousCondition);
PREP(registerUnconsciousCondition); PREP(registerUnconsciousCondition);
PREP(cleanUpCopyOfBody_F); PREP(cleanUpCopyOfBody);
PREP(makeCopyOfBody_F); PREP(makeCopyOfBody);
PREP(canGoUnconsciousState); PREP(canGoUnconsciousState);
PREP(setDead); PREP(setDead);
PREP(moduleBasicRevive); PREP(moduleBasicRevive);

View File

@ -42,7 +42,7 @@ if (!alive _unit) exitwith {
[_caller, false] call FUNC(treatmentMutex); [_caller, false] call FUNC(treatmentMutex);
[{ [{
_this call FUNC(actionCarryUnit); _this call FUNC(actionCarryUnit);
}, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute);
}; };
if !([_caller,_unit] call EFUNC(common,carryObj)) exitwith { if !([_caller,_unit] call EFUNC(common,carryObj)) exitwith {

View File

@ -40,7 +40,7 @@ if (!alive _unit) exitwith {
[_caller, false] call FUNC(treatmentMutex); [_caller, false] call FUNC(treatmentMutex);
[{ [{
_this call FUNC(actionDragUnit); _this call FUNC(actionDragUnit);
}, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute);
}; };
if (primaryWeapon _caller == "") then { if (primaryWeapon _caller == "") then {

View File

@ -22,7 +22,7 @@ if ([_unit] call cse_fnc_isAwake) exitwith {
[_caller,objNull] call cse_fnc_carryObj; [_caller,objNull] call cse_fnc_carryObj;
[_unit,objNull] call cse_fnc_carryObj; [_unit,objNull] call cse_fnc_carryObj;
_vehicle = [_caller, _unit] call EFUNC(common,loadPerson_F); _vehicle = [_caller, _unit] call EFUNC(common,loadPerson);
if (!isNull _vehicle) then { if (!isNull _vehicle) then {
if (!isnil QGVAR(DROP_ADDACTION)) then { if (!isnil QGVAR(DROP_ADDACTION)) then {
_caller removeAction GVAR(DROP_ADDACTION); _caller removeAction GVAR(DROP_ADDACTION);

View File

@ -36,7 +36,7 @@ _bodyBagCreated setvariable [QEGVAR(common,nameOfBody), _nameOfUnit, true];
// reset the position to ensure it is on the correct one. // reset the position to ensure it is on the correct one.
_bodyBagCreated setPos _onPosition; _bodyBagCreated setPos _onPosition;
[[_bodyBagCreated], QEFUNC(common,revealObject_f), true] call BIS_fnc_MP; [[_bodyBagCreated], QEFUNC(common,revealObject), true] call BIS_fnc_MP;
_bodyBagCreated setvariable [QEGVAR(logistics,enableDrag), true, true]; _bodyBagCreated setvariable [QEGVAR(logistics,enableDrag), true, true];

View File

@ -19,7 +19,7 @@ _drag = [_this, 2, false, [false]] call BIS_fnc_Param;
if (vehicle _unit == _unit) exitwith {}; if (vehicle _unit == _unit) exitwith {};
if (([_unit] call cse_fnc_isAwake)) exitwith {}; if (([_unit] call cse_fnc_isAwake)) exitwith {};
if ([_caller, _unit] call EFUNC(common,unloadPerson_F)) then { if ([_caller, _unit] call EFUNC(common,unloadPerson)) then {
if (_drag) then { if (_drag) then {
if ((vehicle _caller) == _caller) then { if ((vehicle _caller) == _caller) then {
[[_caller,_unit], QUOTE(FUNC(actionDragUnit)), _caller, false] call BIS_fnc_MP; [[_caller,_unit], QUOTE(FUNC(actionDragUnit)), _caller, false] call BIS_fnc_MP;

View File

@ -13,12 +13,12 @@
private ["_unit", "_copy"]; private ["_unit", "_copy"];
_unit = _this select 0; _unit = _this select 0;
_copy = _unit getvariable QGVAR(copyOfBody_f); _copy = _unit getvariable QGVAR(copyOfBody);
if (isnil "_copy") exitwith {false}; if (isnil "_copy") exitwith {false};
[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call EFUNC(common,debug); [format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call EFUNC(common,debug);
// lets clean it up // lets clean it up
_unit setvariable [QGVAR(originalCopy_f), nil, true]; _unit setvariable [QGVAR(originalCopy), nil, true];
_unit setvariable [QGVAR(copyOfBody_f), nil, true]; _unit setvariable [QGVAR(copyOfBody), nil, true];
if (!isNull _copy) then { if (!isNull _copy) then {
deleteVehicle _copy; deleteVehicle _copy;
}; };

View File

@ -38,7 +38,7 @@ if (_bloodVolume < 100.0) then {
_bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND;
_ivVolume = (_unit getvariable [QGVAR(salineIVVolume), 0]) + IV_CHANGE_PER_SECOND; _ivVolume = (_unit getvariable [QGVAR(salineIVVolume), 0]) + IV_CHANGE_PER_SECOND;
_unit setvariable [QGVAR(salineIVVolume),_ivVolume]; _unit setvariable [QGVAR(salineIVVolume),_ivVolume];
if ([QEGVAR(fieldRations,module)] call EFUNC(common,isModuleEnabled_F)) then { if ([QEGVAR(fieldRations,module)] call EFUNC(common,isModuleEnabled)) then {
if ([_unit] call EFUNC(fieldRations,canDrink)) then { if ([_unit] call EFUNC(fieldRations,canDrink)) then {
_unit setvariable [QEGVAR(fieldRations,drinkStatus), (_unit getvariable [QEGVAR(fieldRations,drinkStatus), 100]) + 0.2]; _unit setvariable [QEGVAR(fieldRations,drinkStatus), (_unit getvariable [QEGVAR(fieldRations,drinkStatus), 100]) + 0.2];
}; };

View File

@ -13,8 +13,8 @@
private ["_unit","_return"]; private ["_unit","_return"];
_unit = _this select 0; _unit = _this select 0;
if (isnil QGVAR(unconsciousConditions_F)) then { if (isnil QGVAR(unconsciousConditions)) then {
GVAR(unconsciousConditions_F) = []; GVAR(unconsciousConditions) = [];
}; };
_return = false; _return = false;
@ -25,5 +25,5 @@ _return = false;
}; };
}; };
if (_return) exitwith{}; if (_return) exitwith{};
}foreach GVAR(unconsciousConditions_F); }foreach GVAR(unconsciousConditions);
_return _return

View File

@ -26,7 +26,7 @@ if ((isNull ([_caller] call EFUNC(common,getCarriedObj))) || !([_caller] call EF
_caller removeWeapon "ACE_FakePrimaryWeapon"; _caller removeWeapon "ACE_FakePrimaryWeapon";
}; };
[_target, false] call EFUNC(common,disableAI_f); [_target, false] call EFUNC(common,disableAI);
_caller setvariable[QGVAR(onStartMovingUnitParams), nil]; _caller setvariable[QGVAR(onStartMovingUnitParams), nil];
// handle the drag & carry administration // handle the drag & carry administration

View File

@ -56,7 +56,7 @@ if (alive _unit) exitwith {
_unit setDamage 0; _unit setDamage 0;
// Resetting potential revive state // Resetting potential revive state
[_unit,QEGVAR(common,ENABLE_REVIVE_SETDEAD_F), 0] call EFUNC(common,setDefinedVariable); [_unit,QEGVAR(common,ENABLE_REVIVE_SETDEAD), 0] call EFUNC(common,setDefinedVariable);
[_unit,QEGVAR(common,ENABLE_REVIVE_COUNTER), 0] call EFUNC(common,setDefinedVariable); [_unit,QEGVAR(common,ENABLE_REVIVE_COUNTER), 0] call EFUNC(common,setDefinedVariable);

View File

@ -93,7 +93,7 @@ if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) > 0) exitwit
// Check vitals for medical status // Check vitals for medical status
// TODO check for in revive state instead of variable // TODO check for in revive state instead of variable
if ((_unit getvariable[QEGVAR(common,ENABLE_REVIVE_SETDEAD_F),0]) == 0) then { if ((_unit getvariable[QEGVAR(common,ENABLE_REVIVE_SETDEAD),0]) == 0) then {
_bloodPressureL = _bloodPressure select 0; _bloodPressureL = _bloodPressure select 0;
_bloodPressureH = _bloodPressure select 1; _bloodPressureH = _bloodPressure select 1;

View File

@ -15,10 +15,10 @@ _logic = _this select 0;
GVAR(Module) = true; GVAR(Module) = true;
[_logic, QGVAR(ENABLE_REVIVE_F), "enableFor" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(ENABLE_REVIVE), "enableFor" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(REVIVE_TIMER_MAX_F), "timer" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(REVIVE_TIMER_MAX), "timer" ] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(REVIVE_NUMBER_MAX_F), "amountOf" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(REVIVE_NUMBER_MAX), "amountOf" ] call EFUNC(common,readSettingFromModule);
[ [
{(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD_F),0]) > 0)} {(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD),0]) > 0)}
] call FUNC(registerUnconsciousCondition); ] call FUNC(registerUnconsciousCondition);

View File

@ -6,7 +6,7 @@ if (!local _unit) exitwith {};
[_unit, QGVAR(amountOfPain),0,true] call EFUNC(common,setDefinedVariable); [_unit, QGVAR(amountOfPain),0,true] call EFUNC(common,setDefinedVariable);
[_unit, QGVAR(heartRate),0,true] call EFUNC(common,setDefinedVariable); [_unit, QGVAR(heartRate),0,true] call EFUNC(common,setDefinedVariable);
[_unit, QGVAR(bloodPressure), [0,0],true] call EFUNC(common,setDefinedVariable); [_unit, QGVAR(bloodPressure), [0,0],true] call EFUNC(common,setDefinedVariable);
if (_unit getvariable[QEGVAR(common,unconscious_non_captive_f),false]) then { if (_unit getvariable[QEGVAR(common,unconscious_non_captive),false]) then {
_unit setCaptive false; _unit setCaptive false;
_unit setvariable[QEGVAR(common,unconscious_non_captive_f),nil]; _unit setvariable[QEGVAR(common,unconscious_non_captive),nil];
}; };

View File

@ -20,6 +20,6 @@ _dragging = _this select 3;
_caller setvariable[QGVAR(onStartMovingUnitParams), [_caller, _target, _killOnDrop, _dragging]]; _caller setvariable[QGVAR(onStartMovingUnitParams), [_caller, _target, _killOnDrop, _dragging]];
[_target, true] call EFUNC(common,disableAI_f); [_target, true] call EFUNC(common,disableAI);
nil; nil;

View File

@ -10,13 +10,13 @@
#include "script_component.hpp" #include "script_component.hpp"
if (isnil QGVAR(unconsciousConditions_F)) then { if (isnil QGVAR(unconsciousConditions)) then {
GVAR(unconsciousConditions_F) = []; GVAR(unconsciousConditions) = [];
}; };
if (typeName _this == typeName []) then { if (typeName _this == typeName []) then {
{ {
if (typeName _x == typeName {}) then { if (typeName _x == typeName {}) then {
GVAR(unconsciousConditions_F) pushback _x; GVAR(unconsciousConditions) pushback _x;
}; };
}foreach _this; }foreach _this;
}; };

View File

@ -24,11 +24,11 @@ if (!local _unit) exitwith {
[[_unit, _force], QUOTE(FUNC(setDead)), _unit, false] call BIS_fnc_MP; [[_unit, _force], QUOTE(FUNC(setDead)), _unit, false] call BIS_fnc_MP;
}; };
if (isnil QGVAR(ENABLE_REVIVE_F)) then { if (isnil QGVAR(ENABLE_REVIVE)) then {
GVAR(ENABLE_REVIVE_F) = 0; GVAR(ENABLE_REVIVE) = 0;
}; };
if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == 2)) && !_force && (alive (vehicle _unit))) exitwith { if (((GVAR(ENABLE_REVIVE) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE) == 2)) && !_force && (alive (vehicle _unit))) exitwith {
// enter revive state // enter revive state
_unit setvariable ["ACE_inReviveState", true, true]; _unit setvariable ["ACE_inReviveState", true, true];
@ -36,11 +36,11 @@ if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) ==
[_unit] call FUNC(setUnconsciousState); [_unit] call FUNC(setUnconsciousState);
// setting the revive default values // setting the revive default values
if (isnil QGVAR(REVIVE_TIMER_F)) then { if (isnil QGVAR(REVIVE_TIMER)) then {
GVAR(REVIVE_TIMER_F) = 10; GVAR(REVIVE_TIMER) = 10;
}; };
if (isnil QGVAR(REVIVE_NUMBER_MAX_F)) then { if (isnil QGVAR(REVIVE_NUMBER_MAX)) then {
GVAR(REVIVE_NUMBER_MAX_F) = -1; GVAR(REVIVE_NUMBER_MAX) = -1;
}; };
[{ [{
@ -58,7 +58,7 @@ if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) ==
}; };
_counter = _unit getvariable ["ACE_reviveCounterValue", 0]; _counter = _unit getvariable ["ACE_reviveCounterValue", 0];
if (_counter >= GVAR(REVIVE_TIMER_F)) exitwith{ if (_counter >= GVAR(REVIVE_TIMER)) exitwith{
if (isPlayer _unit) then { if (isPlayer _unit) then {
titleText ["You died..","PLAIN DOWN"]; titleText ["You died..","PLAIN DOWN"];
}; };

View File

@ -41,17 +41,17 @@ _originalPos = unitPos _unit;
// Handle the on screen effects // Handle the on screen effects
if (isPlayer _unit) then { if (isPlayer _unit) then {
[] call EFUNC(common,closeAllDialogs_f); [] call EFUNC(common,closeAllDialogs);
[true] call FUNC(effectBlackOut); [true] call FUNC(effectBlackOut);
["unconscious", true] call EFUNC(common,setDisableUserInputStatus); ["unconscious", true] call EFUNC(common,setDisableUserInputStatus);
[false] call EFUNC(common,setVolume_f); [false] call EFUNC(common,setVolume);
} else { } else {
_unit setUnitPos "DOWN"; _unit setUnitPos "DOWN";
[_unit, true] call EFUNC(common,disableAI_F); [_unit, true] call EFUNC(common,disableAI);
}; };
// So the AI does not get stuck, we are moving the unit to a temp group on its own. // So the AI does not get stuck, we are moving the unit to a temp group on its own.
[_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide_f); [_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide);
_captiveSwitch = [_unit, true] call EFUNC(common,setCaptiveSwitch); _captiveSwitch = [_unit, true] call EFUNC(common,setCaptiveSwitch);
[_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation);
@ -110,15 +110,15 @@ _minWaitingTime = (round(random(10)+5));
_unit setUnconscious false; _unit setUnconscious false;
// Swhich the unit back to its original group // Swhich the unit back to its original group
[_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide_f); [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide);
// Reset any visual and audio effects for players, or enable everything again for AI. // Reset any visual and audio effects for players, or enable everything again for AI.
if (isPlayer _unit) then { if (isPlayer _unit) then {
[false] call FUNC(effectBlackOut); [false] call FUNC(effectBlackOut);
[true] call EFUNC(common,setVolume_f); [true] call EFUNC(common,setVolume);
["unconscious", false] call EFUNC(common,setDisableUserInputStatus); ["unconscious", false] call EFUNC(common,setDisableUserInputStatus);
} else { } else {
[_unit, false] call EFUNC(common,disableAI_F); [_unit, false] call EFUNC(common,disableAI);
_unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP)
}; };