Skip to content

Commit

Permalink
Use 2.18 syntax of deleteVehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Jan 15, 2025
1 parent 35c325b commit 3d70815
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
} forEach _addedPickUpHelpers;
} else {
TRACE_1("Cleaning Pick Up Helpers",count _addedPickUpHelpers);
{deleteVehicle _x} forEach _addedPickUpHelpers;
deleteVehicle _addedPickUpHelpers;
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
}, 0, [(getPosASL ACE_player) vectorAdd [-100, 0, 0], [], [], []]] call CBA_fnc_addPerFrameHandler;
12 changes: 3 additions & 9 deletions addons/cookoff/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,18 @@ if (isServer) then {

// Handle cleaning up effects when objects are deleted mid cook-off
["AllVehicles", "Deleted", {
{
deleteVehicle _x;
} forEach ((_this select 0) getVariable [QGVAR(effects), []]);
deleteVehicle ((_this select 0) getVariable [QGVAR(effects), []]);
}, true, ["Man", "StaticWeapon"], true] call CBA_fnc_addClassEventHandler; // Use "Man" to exclude animals as well

["ReammoBox_F", "Deleted", {
{
deleteVehicle _x;
} forEach ((_this select 0) getVariable [QGVAR(effects), []]);
deleteVehicle ((_this select 0) getVariable [QGVAR(effects), []]);
}, true, [], true] call CBA_fnc_addClassEventHandler;

// Raised when the flames have subsided or after the ammo of a box has finished cooking off
[QGVAR(cleanupEffects), {
params ["_object"];

{
deleteVehicle _x;
} forEach (_object getVariable [QGVAR(effects), []]);
deleteVehicle (_object getVariable [QGVAR(effects), []]);

_object setVariable [QGVAR(effects), nil];
}] call CBA_fnc_addEventHandler;
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/functions/fnc_interactEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (

if (!EGVAR(interact_menu,keyDown)) then {
TRACE_1("Cleaning defuse helpers",count _addedHelpers);
{deleteVehicle _x} forEach _addedHelpers;
deleteVehicle _addedHelpers;
[_pfhID] call CBA_fnc_removePerFrameHandler;
} else {
// Prevent Rare Error when ending mission with interact key down
Expand Down
2 changes: 1 addition & 1 deletion addons/fastroping/functions/fnc_cutRopes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
//Only delete the hook first so the rope falls down.
//Note: ropeDetach was used here before, but the command seems a bit broken.
deleteVehicle _hook;
[{{deleteVehicle _x} forEach _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute;
[{deleteVehicle _this}, [_ropeTop, _ropeBottom, _dummy], 60] call CBA_fnc_waitAndExecute;
} forEach _deployedRopes;

_vehicle setVariable [QGVAR(deployedRopes), [], true];
Expand Down
4 changes: 1 addition & 3 deletions addons/frag/functions/fnc_dev_clearTraces.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* Public: No
*/

{
deleteVehicle _x;
} forEach GVAR(dev_eventSpheres);
deleteVehicle GVAR(dev_eventSpheres);

GVAR(dev_eventSpheres) = [];

Expand Down
2 changes: 1 addition & 1 deletion addons/grenades/functions/fnc_incendiary.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ if (isServer) then {
};

[{
{deleteVehicle _x} forEach _this;
deleteVehicle _this;
}, [_fire, _smoke, _light, _sound], _timeToLive] call CBA_fnc_waitAndExecute;

// Damage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (!isNull objectParent ACE_player) exitWith {};
_args params ["_setPosition", "_addedHelpers", "_housesScanned", "_housesToScanForActions"];

if (!EGVAR(interact_menu,keyDown)) then {
{deleteVehicle _x;} forEach _addedHelpers;
deleteVehicle _addedHelpers;
[_pfID] call CBA_fnc_removePerFrameHandler;
} else {
// Prevent Rare Error when ending mission with interact key down:
Expand Down
2 changes: 1 addition & 1 deletion addons/logistics_wirecutter/functions/fnc_interactEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TRACE_1("Starting wirecuter interact PFH",_interactionType);
_args params ["_setPosition", "_addedHelpers", "_fencesHelped"];

if (!EGVAR(interact_menu,keyDown)) then {
{deleteVehicle _x} forEach _addedHelpers;
deleteVehicle _addedHelpers;
[_pfhID] call CBA_fnc_removePerFrameHandler;
} else {
// Prevent rare error when ending mission with interact key down
Expand Down
2 changes: 1 addition & 1 deletion addons/spectator/functions/fnc_cam.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if (_init) then {
GVAR(camDummy) = nil;

// Stop tracking everything
{ deleteVehicle _x; } forEach GVAR(camLights);
deleteVehicle GVAR(camLights);
GVAR(camLights) = nil;

GVAR(camMode) = nil;
Expand Down
2 changes: 1 addition & 1 deletion addons/spectator/functions/fnc_ui_handleKeyDown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if (_key == DIK_PGDN) exitWith {
// Handle spectate lights
if (_key == DIK_L) exitWith {
if (GVAR(camLight)) then {
{ deleteVehicle _x; } forEach GVAR(camLights);
deleteVehicle GVAR(camLights);
GVAR(camLights) = [];
} else {
private _cameraLight = "#lightpoint" createVehicleLocal getPosASL GVAR(camera);
Expand Down
4 changes: 1 addition & 3 deletions addons/tagging/functions/fnc_createTag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ if (_object getVariable [QGVAR(testVar), false]) then {
_object addEventHandler ["HandleDamage", {
params ["_object", "_selection", "_damage"];
if (_selection == "" && _damage >= 1) then {
{
deleteVehicle _x;
} forEach (_object getVariable [QGVAR(attachedTags), []]);
deleteVehicle (_object getVariable [QGVAR(attachedTags), []]);
_object setVariable [QGVAR(attachedTags), []];
};
}];
Expand Down

0 comments on commit 3d70815

Please sign in to comment.