ACE3/addons/common/functions/fnc_addSwayFactor.sqf
Grim e06c6f7835
General - Replace toLower with toLowerANSI where applicable (#9790)
* General - Replace toLower with toLowerANSI where applicable

* whoops

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/repair/functions/fnc_setHitPointDamage.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/repair/dev/draw_showRepairInfo.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/tagging/XEH_preStart.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/vehicle_damage/functions/fnc_handleCookoff.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/tagging/XEH_preStart.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* comparment -> compartment

* Update fnc_showHud.sqf

* Update fnc_registerObjects.sqf

* Update addons/common/functions/fnc_cbaSettings_settingChanged.sqf

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
2024-03-07 22:08:13 +01:00

36 lines
959 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: LinkIsGrim
* Adds a factor to player sway calculation
*
* Arguments:
* 0: Type of factor, "baseline" or "multiplier" <STRING>
* 1: Factor function, must return number <CODE>
* 2: Factor ID, unique to type <STRING>
*
* Return Value:
* Factor added <BOOLEAN>
*
* Example:
* ["baseline", {1}, "ace_common"] call ace_common_fnc_addSwayFactor
*
* Public: Yes
*/
params ["_type", "_code", "_id"];
_type = toLowerANSI _type;
if !(_type in ["baseline", "multiplier"]) exitWith { ERROR_2("%1-%2 type unsupported",_type,_id); false };
if !((call _code) isEqualType 0) exitWith { ERROR_2("%1-%2 bad return type",_type,_id); false };
[missionNamespace, format ["ACE_setCustomAimCoef_%1", _type], _id, _code] call FUNC(arithmeticSetSource);
if (_type isEqualTo "baseline") then {
GVAR(swayFactorsBaseline) pushBackUnique [_id];
} else {
GVAR(swayFactorsMultiplier) pushBackUnique [_id];
};
true