Skip to content

Commit

Permalink
handled in fnc_setSpeedLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
ampersand38 committed Oct 13, 2023
1 parent 220b8c7 commit 0b7b802
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
11 changes: 0 additions & 11 deletions addons/attributes/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,3 @@ if (isServer) then {
_unit enableAIFeature [_x, _abilities select _forEachIndex];
} forEach AI_ABILITIES;
}] call CBA_fnc_addEventHandler;

["CAManBase", "Local", { // If locality changes, forceSpeed must be reapplied.
params ["_entity", "_isLocal"];
if (!_isLocal || {!alive _entity} || {!(_entity isKindOf "CAManBase")}) exitWith {};

private _setSpeed = _entity getVariable [QGVAR(setSpeed), 0];

if (_setSpeed != 0) then {
[_entity, _setSpeed] call FUNC(setSpeed);
};
}, true, [], true] call CBA_fnc_addClassEventHandler;
8 changes: 1 addition & 7 deletions addons/attributes/initAttributes.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,12 @@
{GVAR(enableAmmo) && {alive _entity} && {_entity call EFUNC(common,getVehicleAmmo) != -1}}
] call FUNC(addAttribute);

#define MAX_SPEED_HELI 300
[ // Helicopter
"Object",
[ELSTRING(Modules,ModuleConvoyParameters_Speed), LSTRING(SpeedLimit_Tooltip_Helicopter)],
QGVAR(slider),
[-50, MAX_SPEED_HELI, 5, false, 0],
[-50, 300, 5, false, 0],
{
if (_value == 0) then {
// There doesn't seem to be a way to remove this for a helicopter, so set to more than max
// 0 is not needed, use Toggle AI Path instead
_value = MAX_SPEED_HELI;
};
private _vehicles = [] call EFUNC(common,getSelectedVehicles) select {
alive _x && {!isPlayer driver _x} && {_x isKindOf "Helicopter"}
};
Expand Down

0 comments on commit 0b7b802

Please sign in to comment.