diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf index a55b9f9875..0c5fda5b4c 100644 --- a/addons/sandbag/functions/fnc_canDeploy.sqf +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -6,10 +6,10 @@ * None * * Return Value: - * can deploy? + * Can deploy * * Example: - * call ace_sandbag_fnc_canDeploy; + * [] call ace_sandbag_fnc_canDeploy * * Public: No */ @@ -22,6 +22,7 @@ if (ACE_player getVariable [QGVAR(usingSandbag), false]) exitWith { false }; if ((getPosATL ACE_player select 2) - (getPos ACE_player select 2) > 1E-5) exitWith { false }; private ["_surfaceClass", "_surfaceType"]; + _surfaceClass = ([surfaceType (position ACE_player), "#"] call CBA_fnc_split) select 1; _surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); diff --git a/addons/sandbag/functions/fnc_carry.sqf b/addons/sandbag/functions/fnc_carry.sqf index f2ba3dff8a..84ab8c1883 100644 --- a/addons/sandbag/functions/fnc_carry.sqf +++ b/addons/sandbag/functions/fnc_carry.sqf @@ -10,39 +10,39 @@ * None * * Example: - * [_sandbag, _unit] call ace_sandbag_fnc_carry; + * [_sandbag, _unit] call ace_sandbag_fnc_carry * * Public: No */ #include "script_component.hpp" -PARAMS_2(_sandbag,_unit); +params ["_sandbag", "_unit"]; _unit playActionNow "PutDown"; _unit setVariable [QGVAR(usingSandbag), true]; [{ - PARAMS_2(_sandbag,_unit); - + params ["_sandbag", "_unit"]; + GVAR(carrier) = ACE_player; - + [GVAR(carrier), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); - + deleteVehicle _sandbag; - - GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"]; + + GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; GVAR(sandBag) enableSimulationGlobal false; - + // Force physx update { _x setPosASL (getPosASL _x); - } forEach (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]); + } count (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]); GVAR(carryPFH) = [{ if (GVAR(carrier) != ACE_player) exitWith { call FUNC(drop); }; - GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0])); + GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player); }, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 1e1121409b..5bb162e029 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deploy; + * [] call ace_sandbag_fnc_deploy * * Public: No */ @@ -21,14 +21,14 @@ GVAR(placer) = ACE_player; [GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); -GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"]; +GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; GVAR(sandBag) enableSimulationGlobal false; GVAR(deployPFH) = [{ if (GVAR(placer) != ACE_player) exitWith { call FUNC(deployCancel); }; - GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0])); + GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player); }, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index 65677ea887..bb7480a59e 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deployCancel; + * [] call ace_sandbag_fnc_deployCancel * * Public: No */ diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 2cb297c51e..61264c15fe 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deployConfirm; + * [] call ace_sandbag_fnc_deployConfirm * * Public: No */ @@ -36,16 +36,16 @@ GVAR(placer) setVariable [QGVAR(usingSandbag), true]; private ["_sandBag", "_position", "_direction"]; _position = getPosASL GVAR(sandBag); _direction = getDir GVAR(sandBag); - + deleteVehicle GVAR(sandBag); - - _sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"]; + + _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; _sandBag enableSimulationGlobal true; _sandBag setPosASL _position; _sandBag setDir _direction; - + GVAR(placer) removeItem "ACE_Sandbag_empty"; - + GVAR(sandBag) = objNull; GVAR(placer) = objNull; }, [], 1.0, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_drop.sqf b/addons/sandbag/functions/fnc_drop.sqf index 1ef61289bf..3ba825d423 100644 --- a/addons/sandbag/functions/fnc_drop.sqf +++ b/addons/sandbag/functions/fnc_drop.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deployCancel; + * [] call ace_sandbag_fnc_deployCancel * * Public: No */ @@ -34,14 +34,14 @@ GVAR(carrier) playActionNow "PutDown"; private ["_sandBag", "_position", "_direction"]; _position = getPosASL GVAR(sandBag); _direction = getDir GVAR(sandBag); - + deleteVehicle GVAR(sandBag); - - _sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"]; + + _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; _sandBag enableSimulationGlobal true; _sandBag setPosASL _position; _sandBag setDir _direction; - + GVAR(sandBag) = objNull; GVAR(carrier) = objNull; }, [], 1.0, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_handleScrollWheel.sqf b/addons/sandbag/functions/fnc_handleScrollWheel.sqf index 2b831f5cdc..94697d7691 100644 --- a/addons/sandbag/functions/fnc_handleScrollWheel.sqf +++ b/addons/sandbag/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * handled * * Example: - * 1.2 call ace_sandbag_fnc_handleScrollWheel; + * [1.2] call ace_sandbag_fnc_handleScrollWheel * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(deployPFH) == -1) exitWith { false }; diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf index 360a18983a..dd0b93fd59 100644 --- a/addons/sandbag/functions/fnc_pickup.sqf +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -10,26 +10,26 @@ * None * * Example: - * [_sandbag, _unit] call ace_sandbag_fnc_pickup; + * [_sandbag, _unit] call ace_sandbag_fnc_pickup * * Public: No */ #include "script_component.hpp" -PARAMS_2(_sandbag,_unit); +params ["_sandbag", "_unit"]; _unit playActionNow "PutDown"; _unit setVariable [QGVAR(usingSandbag), true]; [{ - PARAMS_2(_sandbag,_unit); + params ["_sandbag", "_unit"]; _unit setVariable [QGVAR(usingSandbag), false]; deletevehicle _sandbag; - + // Force physx update { _x setPosASL (getPosASL _x); - } forEach (_unit nearObjects ["ACE_SandbagObject", 5]); - + } count (_unit nearObjects ["ACE_SandbagObject", 5]); + [_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory); }, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute);