ACE3/addons/spectator/functions/fnc_cam_toggleSlow.sqf
Neviothr 75f7ed7532
Utilize isNotEqualTo (#7929)
* Utilize isNotEqualTo

* undo changes to some files

* redo some changes, fix based on @Vdauphin 's comment

* fix validator issues

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2021-02-27 11:05:05 -06:00

36 lines
799 B
Plaintext

#include "script_component.hpp"
/*
* Author: Nelson Duarte, SilentSpike
* Function used to set camera slow speed mode
*
* Arguments:
* 0: Enable slow speed <BOOL>
*
* Return Value:
* None
*
* Example:
* [true] call ace_spectator_fnc_cam_toggleSlow
*
* Public: No
*/
params ["_slowSpeed"];
if (GVAR(camSlow) isNotEqualTo _slowSpeed) then {
private _camera = GVAR(camera);
if (GVAR(camMode) == MODE_FREE) then {
GVAR(camSlow) = _slowSpeed;
if (_slowSpeed) then {
_camera camCommand format ["speedDefault %1", SPEED_SLOW];
} else {
_camera camCommand format ["speedDefault %1", SPEED_DEFAULT];
};
} else {
_camera camCommand format ["speedDefault %1", SPEED_DEFAULT];
GVAR(camSlow) = false;
};
};