ACE3/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf
Glowbal b489750d5b Minor optimizations using private, params, and isEqualType (#4323)
* Optimizations with private, params, and isEqualType

* Fixed tab being used instead of space

* Fixed tabs inserted by notepad++

* More usage of new private syntax and params

- changed a few checks for an array being empty to `_arr isEqualTo []`
rather than `count _arr == 0`
- added more uses of `private` on the same line as the variable is
declared
- added more uses of params to assign variables passed as parameters
- removed unnecessary parentheses
- removed several unnecessary variable declarations with private array
syntax

* clean up and formatting
2016-09-04 16:44:22 +02:00

31 lines
678 B
Plaintext

/*
* Author: PabstMirror
* Handles the double tapping either of the 2 mini-maps
*
* Arguments:
* 0: The Map <CONTROL>
* 1: MouseButton <NUMBER>
* 2: MousePosX <NUMBER>
* 3: MousePosY <NUMBER>
*
* Return Value:
* None
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
*
* Public: No
*/
#include "script_component.hpp"
params ["_theMap", "_mouseButton", "_xPos", "_yPos"];
//Only handle LMB
if (_mouseButton != 0) exitWith {};
private _worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
_worldPos pushBack (getTerrainHeightASL _worldPos);
GVAR(newWaypointPosition) = _worldPos;
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);