Static line code suggestion
Closed, ResolvedPublic

Description

Change AirVehicles\CUP_AirVehicles_StaticLine\functions\fn_canDeployStaticLine.sqf to:

(player in _target) && {(getPosATL _target) #2 > 140 } && { (driver _target) != player } && { missionNamespace getVariable ['CUP_Jumping_Condition', false] }

Change AirVehicles\CUP_AirVehicles_StaticLine\Scripts\static_line_init.sqf to:

if (!hasInterface) exitWith {};

["Air", "init", {
    params ["_vehicle"];
    
    if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "CUP_Jumping_enabled")) == 1) then {
        _vehicle addAction [
            "<t color='#2E9AFE'>Static Line Paradrop</t>",
            "call CUP_fnc_deployStaticLine",
            [],
            0,
            true,
            true,
            "",
            "call CUP_fnc_canDeployStaticLine"
        ];
    };
}, true, [], true] call CBA_fnc_addClassEventHandler;

This should have increased performance as the addAction condition check is not run every frame when the player is not in a air vehicle.
This also fixes a bug with respawn, as the previous method of player addAction [ would not transfer to the respawned player.

Details

Commits
Restricted Diffusion Commit
Branch
Release/Stable
jonpas claimed this task.Feb 15 2019, 1:33 PM
PabstMirror changed the task status from Needs Review to In Progress.
PabstMirror triaged this task as Low priority.
PabstMirror added a subscriber: jonpas.
PabstMirror closed this task as Resolved by committing Restricted Diffusion Commit.Tue, Mar 12, 4:14 PM
PabstMirror added a commit: Restricted Diffusion Commit.