diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf index dbce4a9b92..dc6424f172 100644 --- a/addons/concertina_wire/XEH_init.sqf +++ b/addons/concertina_wire/XEH_init.sqf @@ -1,4 +1,3 @@ #include "script_component.hpp" - -PARAMS_1(_wire); -_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; \ No newline at end of file +params ["_wire"]; +_wire addEventHandler ["HandleDamage", FUNC(handleDamage)]; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index 5548cad649..aedc8b9608 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -8,10 +8,9 @@ * 1: unit * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -22,7 +21,7 @@ private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"]; _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; { _wireNoGeo animate [_x, 1]; -} foreach WIRE_FAST; +} count WIRE_FAST; GVAR(placer) = _unit; _dir = getDir _unit; @@ -37,8 +36,9 @@ deleteVehicle _wirecoil; _unit setVariable [QGVAR(wireDeployed), false]; GVAR(deployPFH) = [{ - EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit); - + params ["_args", "_idPFH"]; + _args params ["_wireNoGeo", "_wireNoGeoPos", "_unit"]; + private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); _posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit); @@ -46,37 +46,38 @@ GVAR(deployPFH) = [{ _dir = _dirVect call CBA_fnc_vectDir; _range = vectorMagnitude _dirVect; _anim = 0 max (1 - (_range / 12)); - + if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; { _wire animate [_x, _anim]; - } foreach WIRE_FAST; - + } count WIRE_FAST; + [{ - EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos); + params ["_args", "_idPFH"]; + _args params ["_wireNoGeo", "_wire", "_anim", "_dir", "_wireNoGeoPos"]; if (_wire animationPhase "wire_2" == _anim) then { deleteVehicle _wireNoGeo; _wire setDir _dir; _wire setPosASL _wireNoGeoPos; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler; - + [_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); call EFUNC(interaction,hideMouseHint); - - [_this select 1] call CBA_fnc_removePerFrameHandler; + + [_idPFH] call CBA_fnc_removePerFrameHandler; }; - + _wireNoGeo setDir _dir; { _wireNoGeo animate [_x, _anim]; - } foreach WIRE_FAST; + } count WIRE_FAST; }, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); - + GVAR(placer) setVariable [QGVAR(Deploy), [GVAR(placer), "DefaultAction", {GVAR(deployPFH) != -1}, diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index c9a5d1f9ff..c7ba3f50b1 100644 --- a/addons/concertina_wire/functions/fnc_dismount.sqf +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -8,10 +8,9 @@ * 1: unit * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -21,8 +20,7 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit _this call FUNC(dismount); }, _this] call EFUNC(common,execNextFrame); }; - -PARAMS_2(_wire,_unit); +params ["_wire", "_unit"]; private ["_config", "_delay"]; _config = (configFile >> "CfgVehicles" >> typeOf _unit); diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index a6e34fe44f..a3f5081271 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -7,10 +7,9 @@ * 0: wire * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -18,25 +17,26 @@ PARAMS_1(_wire); { _wire animate [_x, 1]; -} foreach WIRE_FAST; +} count WIRE_FAST; [{ - EXPLODE_1_PVT(_this select 0,_wire); - + params ["_args", "_idPFH"]; + _args params ["_wire"]; + if (_wire animationPhase "wire_2" == 1) then { private ["_dir", "_pos", "_wirecoil"]; - + _dir = getDir _wire; _pos = getPosASL _wire; - + _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; deleteVehicle _wire; - + _wirecoil setDir _dir; _wirecoil setPosASL _pos; _wirecoil setVelocity [0, 0, 0]; - - [_this select 1] call CBA_fnc_removePerFrameHandler; + + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_wire]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/concertina_wire/functions/fnc_handleDamage.sqf b/addons/concertina_wire/functions/fnc_handleDamage.sqf index 61cd1c4e7c..43a04641dd 100644 --- a/addons/concertina_wire/functions/fnc_handleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_handleDamage.sqf @@ -11,15 +11,12 @@ * 4: projectile * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" - -PARAMS_5(_wire,_selectionName,_damage,_source,_projectile); - +params ["_wire", "", "_damage", "_source", ""]; if (_damage < 0.5) exitWith { 0 }; if (!(isNull _source)) then { diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf index f5f84a6afa..ac59798d10 100644 --- a/addons/concertina_wire/functions/fnc_handleKilled.sqf +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -8,14 +8,12 @@ * 1: killer (vehicle) * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" - -PARAMS_2(_wire,_killer); +params ["_wire", "_killer"]; private ["_distance", "_vehicle"]; diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf index e7dff30000..41050eb9b9 100644 --- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf @@ -7,14 +7,12 @@ * 1: vehicle * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" - -PARAMS_2(_wire,_vehicle); +params ["_wire", "_vehicle"]; private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"]; @@ -43,8 +41,8 @@ _dir_w = getDir _wire; if (_mode == 0) then { private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"]; - _x = _pos_w select 0; - _y = _pos_w select 1; + _pos_w params ["_x","_y"]; + // Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle) _wireCheckPosAr = [ [_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],