Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Drofseh opened this issue Jan 18, 2025 · 0 comments

Comments

@Drofseh
Copy link

Drofseh commented Jan 18, 2025

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant