HEMTT icon indicating copy to clipboard operation
HEMTT copied to clipboard

Feature Request - add lint for alt syntax of `deleteVehicle` and `deleteVehicleCrew`

Open Drofseh opened this issue 11 months ago • 0 comments

Both of these commands have an alternative syntax, these are likely faster than using a forEach loop and the original syntaxes.

These are hard to benchmark in game, because running either of them deletes the crew/vehicles that you'd need to have to run it again, but I assume they must be faster or they wouldn't've been added to the game.

deleteVehicleCrew

https://community.bistudio.com/wiki/deleteVehicleCrew

{_vehicle deleteVehicleCrew _x} forEach crew _vehicle; vs deleteVehicleCrew _vehicle; v2.06 deleteVehicleCrew <OBJECT>

deleteVehicle

https://community.bistudio.com/wiki/deleteVehicle

{deleteVehicle _x} forEach _vehicles; vs deleteVehicle _vehicles; v2.18 deleteVehicle <ARRAY>

Doing both to clean up crew and vehicles

{
    private _vehicle = _x;
    {
        _vehicle deleteVehicleCrew _x
    } forEach crew _vehicle;

    deleteVehicle _vehicle;
} forEach _vehicles;

vs

{
    deleteVehicleCrew _x;
} forEach _vehicles;

deleteVehicle _vehicles;

Drofseh avatar Jan 18 '25 03:01 Drofseh