<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2016 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: fn_inGameUIActionEvent.sqf
//	@file Author: AgentRev

params ["_target", "_unit", "", "_action", "","", "_showWindow", "","", "_menuOpen"];
private _handled = false;

if (_unit == player && (_showWindow || _menuOpen)) then
{
	switch (true) do
	{
		case (_handled): {};

		case (_action == "UseMagazine"): // placed explosive
		{
			_minDist = ["A3W_remoteBombStoreRadius", 100] call getPublicVar;
			if (_minDist <= 0) exitWith {};

			_nearbyStores = entities "CAManBase" select {_x getVariable ["storeNPC_setupComplete", false] && {player distance _x < _minDist}};

			if !(_nearbyStores isEqualTo []) exitWith
			{
				playSound "FD_CP_Not_Clear_F";
				[format ["You are not allowed to place explosives within %1m of a store.", _minDist], 5] call mf_notify_client;
				_handled = true;
			};

			_nearbyMissions = allMapMarkers select {markerType _x == "Empty" && {[["Mission_","ForestMission_","LandConvoy_"], _x] call fn_startsWith && {player distance markerPos _x < _minDist}}};

			if !(_nearbyMissions isEqualTo []) exitWith
			{
				playSound "FD_CP_Not_Clear_F";
				[format ["You are not allowed to place explosives within %1m of a mission spawn.", _minDist], 5] call mf_notify_client;
				_handled = true;
			};
		};

		case (_action == "DisAssemble" && {{_target isKindOf _x} count ["StaticMGWeapon","StaticGrenadeLauncher","StaticMortar"] > 0}):
		{
			playSound "FD_CP_Not_Clear_F";
			[format ['You are not allowed to disassemble weapons.\nUse the "%1" option instead.', ["STR_R3F_LOG_action_deplacer_objet", "Move"] call getPublicVar], 5] call mf_notify_client;
			_handled = true;
		};

		case (_action == "ManualFire"): // use UAV AI to re-align attack heli turret with pilot crosshair when manual fire is enabled with no gunner (thx KK xoxoxo)
		{
			private _veh = vehicle player;

			if ({_veh isKindOf _x} count ["Heli_Attack_01_base_F","Heli_Attack_02_base_F","VTOL_02_base_F"] > 0 && isNull gunner _veh) then
			{
				_bob = createAgent ["B_UAV_AI", [0,0,0], [], 0, ""];
				_bob setName ["","",""];
				_bob moveInGunner _veh;

				[_veh, _bob] spawn
				{
					params ["_veh", "_bob"];
					_time = time;
					waitUntil {sleep 0.5; (abs (_veh animationSourcePhase "MainTurret") < 0.001 && abs (_veh animationSourcePhase "MainGun") < 0.001) || time - _time > 10};
					deleteVehicle _bob;
				};
			};
		};
<commit_msg>Removed static disassembly block continued<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2016 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: fn_inGameUIActionEvent.sqf
//	@file Author: AgentRev

params ["_target", "_unit", "", "_action", "","", "_showWindow", "","", "_menuOpen"];
private _handled = false;

if (_unit == player && (_showWindow || _menuOpen)) then
{
	switch (true) do
	{
		case (_handled): {};

		case (_action == "UseMagazine"): // placed explosive
		{
			_minDist = ["A3W_remoteBombStoreRadius", 100] call getPublicVar;
			if (_minDist <= 0) exitWith {};

			_nearbyStores = entities "CAManBase" select {_x getVariable ["storeNPC_setupComplete", false] && {player distance _x < _minDist}};

			if !(_nearbyStores isEqualTo []) exitWith
			{
				playSound "FD_CP_Not_Clear_F";
				[format ["You are not allowed to place explosives within %1m of a store.", _minDist], 5] call mf_notify_client;
				_handled = true;
			};

			_nearbyMissions = allMapMarkers select {markerType _x == "Empty" && {[["Mission_","ForestMission_","LandConvoy_"], _x] call fn_startsWith && {player distance markerPos _x < _minDist}}};

			if !(_nearbyMissions isEqualTo []) exitWith
			{
				playSound "FD_CP_Not_Clear_F";
				[format ["You are not allowed to place explosives within %1m of a mission spawn.", _minDist], 5] call mf_notify_client;
				_handled = true;
			};
		};

		/* case (_action == "DisAssemble" && {{_target isKindOf _x} count ["StaticMGWeapon","StaticGrenadeLauncher","StaticMortar"] > 0}):
		{
			playSound "FD_CP_Not_Clear_F";
			[format ['You are not allowed to disassemble weapons.\nUse the "%1" option instead.', ["STR_R3F_LOG_action_deplacer_objet", "Move"] call getPublicVar], 5] call mf_notify_client;
			_handled = true;
		}; */

		case (_action == "ManualFire"): // use UAV AI to re-align attack heli turret with pilot crosshair when manual fire is enabled with no gunner (thx KK xoxoxo)
		{
			private _veh = vehicle player;

			if ({_veh isKindOf _x} count ["Heli_Attack_01_base_F","Heli_Attack_02_base_F","VTOL_02_base_F"] > 0 && isNull gunner _veh) then
			{
				_bob = createAgent ["B_UAV_AI", [0,0,0], [], 0, ""];
				_bob setName ["","",""];
				_bob moveInGunner _veh;

				[_veh, _bob] spawn
				{
					params ["_veh", "_bob"];
					_time = time;
					waitUntil {sleep 0.5; (abs (_veh animationSourcePhase "MainTurret") < 0.001 && abs (_veh animationSourcePhase "MainGun") < 0.001) || time - _time > 10};
					deleteVehicle _bob;
				};
			};
		};

{'fraction_non_alphanumeric': 0.2025789572042609, 'fraction_numerical': 0.015698000373761914, 'mean_word_length': 4.422492401215806, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 2}}
{'dir': 'git-commits-cleaned', 'id': '3095777', 'n_tokens_mistral': 2053, 'n_tokens_neox': 1742, 'n_words': 486}