From 24dd320c3cf8a63a4db2181ec2e20fe472d11df9 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Wed, 5 Aug 2015 01:15:20 +0200 Subject: [PATCH] Updated parameterization in Captives module. --- addons/captives/functions/fnc_canApplyHandcuffs.sqf | 3 +-- addons/captives/functions/fnc_canEscortCaptive.sqf | 3 +-- addons/captives/functions/fnc_canFriskPerson.sqf | 2 +- addons/captives/functions/fnc_canLoadCaptive.sqf | 3 +-- addons/captives/functions/fnc_canRemoveHandcuffs.sqf | 2 +- addons/captives/functions/fnc_canStopEscorting.sqf | 3 +-- addons/captives/functions/fnc_canSurrender.sqf | 6 +++--- addons/captives/functions/fnc_canUnloadCaptive.sqf | 2 +- addons/captives/functions/fnc_doApplyHandcuffs.sqf | 5 +++-- addons/captives/functions/fnc_doEscortCaptive.sqf | 2 +- addons/captives/functions/fnc_doFriskPerson.sqf | 1 + addons/captives/functions/fnc_doLoadCaptive.sqf | 3 ++- addons/captives/functions/fnc_doRemoveHandcuffs.sqf | 2 +- addons/captives/functions/fnc_doUnloadCaptive.sqf | 2 +- addons/captives/functions/fnc_handleGetIn.sqf | 2 +- addons/captives/functions/fnc_handleGetOut.sqf | 2 +- addons/captives/functions/fnc_handleKilled.sqf | 2 +- addons/captives/functions/fnc_handleOnUnconscious.sqf | 2 +- addons/captives/functions/fnc_handlePlayerChanged.sqf | 2 +- addons/captives/functions/fnc_handleRespawn.sqf | 2 +- addons/captives/functions/fnc_handleUnitInitPost.sqf | 2 +- addons/captives/functions/fnc_handleZeusDisplayChanged.sqf | 2 +- addons/captives/functions/fnc_moduleSettings.sqf | 2 +- addons/captives/functions/fnc_moduleSurrender.sqf | 3 ++- addons/captives/functions/fnc_setHandcuffed.sqf | 5 ++--- addons/captives/functions/fnc_setSurrendered.sqf | 3 +-- addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf | 4 ++-- addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf | 3 +-- 28 files changed, 36 insertions(+), 39 deletions(-) diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index e42b5455ff..b351e74ed7 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); - +params ["_unit", "_target"]; //Check sides, Player has cableTie, target is alive and not already handcuffed (GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) && diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 1d9480fd0b..a7c799905e 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); - +params ["_unit", "_target"]; //Alive, handcuffed, not being escored, and not unconscious (_target getVariable [QGVAR(isHandcuffed), false]) && diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf index 5eecc453d4..d164f13ac3 100644 --- a/addons/captives/functions/fnc_canFriskPerson.sqf +++ b/addons/captives/functions/fnc_canFriskPerson.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; _target getVariable [QGVAR(isHandcuffed), false] || {_target getVariable [QGVAR(isSurrendering), false]} diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 04b33ad42d..3f2677da76 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -18,8 +18,7 @@ #include "script_component.hpp" private ["_objects"]; - -PARAMS_3(_unit,_target,_vehicle); +params ["_unit", "_target","_vehicle"]; if (isNull _target) then { _objects = attachedObjects _unit; diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index 4642cd90fd..e8bbe3b50e 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; //Unit is handcuffed and not currently being escorted _target getVariable [QGVAR(isHandcuffed), false] && diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index 56065a43fc..cfafb5a0e8 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); -DEFAULT_PARAM(1,_target,objNull); +params ["_unit", ["_target", objNull]]; if (isNull _target) then { _target = _unit getVariable [QGVAR(escortedUnit), objNull]; diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index 059fb98d03..de0a88d871 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -16,12 +16,12 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_newSurrenderState); - private "_returnValue"; +params ["_unit", "_newSurrenderState"]; + _returnValue = if (_newSurrenderState) then { - //no weapon equiped AND not currently surrendering and + //no weapon equiped AND not currently surrendering and GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])} } else { //is Surrendering diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 59e798a24c..6bd98cf4eb 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -18,6 +18,6 @@ private ["_cargo"]; -PARAMS_2(_player,_unit); +params ["_player", "_unit"]; ((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/captives/functions/fnc_doApplyHandcuffs.sqf b/addons/captives/functions/fnc_doApplyHandcuffs.sqf index 0d15f503e8..21bfe58747 100644 --- a/addons/captives/functions/fnc_doApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_doApplyHandcuffs.sqf @@ -16,10 +16,11 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); -_unit removeItem "ACE_CableTie"; +params ["_unit", "_target"]; playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10]; ["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent); + +_unit removeItem "ACE_CableTie"; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index bc2cd97ffd..bb070b057a 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_state); +params ["_unit", "_target","_state"]; if (_state) then { if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {}; diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index d79c88a5fb..e14025b88f 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -19,6 +19,7 @@ private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; PARAMS_2(_player,_unit); +params ["_player", "_unit"]; _weapon = currentWeapon _player; if (_weapon == primaryWeapon _player && {_weapon != ""}) then { diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 97ecd98a0a..69b7276142 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_vehicle); private "_objects"; +params ["_unit", "_target","_vehicle"]; + if (isNull _target) then { _objects = attachedObjects _unit; _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); diff --git a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf index a69decf620..681b698de3 100644 --- a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf @@ -15,6 +15,6 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; ["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index 5d95189742..46ba618010 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -16,6 +16,6 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index cf7d2c7271..487e7d4179 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_vehicle,_dontcare,_unit); +params ["_vehicle", "_dontcare","_unit"]; if (local _unit) then { if (_unit getVariable [QGVAR(isEscorting), false]) then { diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index 4bf9a1fa19..daf88b7e34 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_vehicle,_dontcare,_unit); +params ["_vehicle", "_dontcare","_unit"]; if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { private ["_cargoIndex"]; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 3eed932d5a..f7b15ec117 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_oldUnit); +params ["_oldUnit"]; if (!local _oldUnit) exitWith {}; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 9aa4856204..ca6362d3da 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_isUnconc); +params ["_unit","_isUnconc"]; if (!local _unit) exitWith {}; diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index 21fd1e1ec3..aea91b5e11 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_newUnit,_oldUnit); +params ["_newUnit","_oldUnit"]; //set showHUD based on new unit status: if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 02888c27a0..6f68aea2fe 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_dead); +params ["_unit","_dead"]; if (!local _unit) exitWith {}; diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf index a8b601300a..66cbcff794 100644 --- a/addons/captives/functions/fnc_handleUnitInitPost.sqf +++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; // prevent players from throwing grenades (added to all units) [_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler); diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index 84b90e78c2..7b30199caf 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_zeusIsOpen); +params ["_unit","_zeusIsOpen"]; //set showHUD based on unit status: if (!_zeusIsOpen) then { diff --git a/addons/captives/functions/fnc_moduleSettings.sqf b/addons/captives/functions/fnc_moduleSettings.sqf index c12ac80b99..db36d712a6 100644 --- a/addons/captives/functions/fnc_moduleSettings.sqf +++ b/addons/captives/functions/fnc_moduleSettings.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" -PARAMS_1(_logic); +parmas ["_logic"]; [_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule); diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 5b40b7663e..64c80af35c 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); private ["_bisMouseOver", "_mouseOverObject"]; +params ["_logic", "_units", "_activated"]; + if (!_activated) exitWith {}; if (local _logic) then { diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index bd141988bb..9bde3b399d 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_state); - +params ["_unit","_state"]; if (!local _unit) exitwith { ERROR("running setHandcuffed on remote unit"); @@ -43,7 +42,7 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ - PARAMS_1(_unit); + params ["_unit"]; if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index c1a34b636c..4fad2d3853 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_state); - +params ["_unit","_state"]; if (!local _unit) exitwith { ERROR("running surrender on remote unit"); diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 626a0b34e4..7e30fe4af4 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -16,10 +16,10 @@ */ #include "script_component.hpp" -PARAMS_2(_target,_vehicle); - private ["_cargoIndex"]; +params ["_target","_vehicle"]; + _target moveInCargo _vehicle; _target assignAsCargo _vehicle; _cargoIndex = _vehicle getCargoIndex _target; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf index 5ef6f01406..000d5ef568 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; _unit setVariable [QGVAR(CargoIndex), -1, true]; moveOut _unit;