<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
/*********************************************************#
# @@ScriptName: territoryActivityHandler.sqf
# @@Author: Nick 'Bewilderbeest' Ludlam <<EMAIL>>
# @@Create Date: 2013-09-15 19:33:17
# @@Modify Date: 2013-09-15 20:15:37
# @@Function:
#*********************************************************/

// Called with [_message, _money(optional)], "A3W_fnc_territoryActivityHandler", side, false] call A3W_fnc_MP;

diag_log format["A3W_fnc_territoryActivityHandler called with %1", _this];

if (typeName _this == "ARRAY" && {count _this >= 1}) then {
	_msg = _this select 0;
	_money = 0; if (count _this >= 2) then { _money = _this select 1; };

	titleText [_msg, "plain down", 0.5];
	if (_money > 0) then
	{
	
	_flagGroup = format ["Flag_%1",current_territorygrp_rnd];
	_inrange_payout = false;
		{
			_marker = _x;
			//markername starts with Flag_ but not with current random territory grp
			if ([_flagGroup, _marker] call fn_startsWith) then
			{
				if ((player distance (getmarkerpos _x))< 2000) then
				{
				_inrange_payout = true;
				};			
			};	
	
		} forEach allMapMarkers;
	
		if (_inrange_payout) then
		{
			player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _money, true];
		}
		else 
		{ <commit_msg>Allow for payment across entire map.  Temporary solution.<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
/*********************************************************#
# @@ScriptName: territoryActivityHandler.sqf
# @@Author: Nick 'Bewilderbeest' Ludlam <<EMAIL>>
# @@Create Date: 2013-09-15 19:33:17
# @@Modify Date: 2013-09-15 20:15:37
# @@Function:
#*********************************************************/

// Called with [_message, _money(optional)], "A3W_fnc_territoryActivityHandler", side, false] call A3W_fnc_MP;

diag_log format["A3W_fnc_territoryActivityHandler called with %1", _this];

if (typeName _this == "ARRAY" && {count _this >= 1}) then {
	_msg = _this select 0;
	_money = 0; if (count _this >= 2) then { _money = _this select 1; };

	titleText [_msg, "plain down", 0.5];
	if (_money > 0) then
	{
	
	_flagGroup = format ["Flag_%1",current_territorygrp_rnd];
	_inrange_payout = false;
		{
			_marker = _x;
			//markername starts with Flag_ but not with current random territory grp
			if ([_flagGroup, _marker] call fn_startsWith) then
			{
				if ((player distance (getmarkerpos _x))< 20000) then
				{
				_inrange_payout = true;
				};			
			};	
	
		} forEach allMapMarkers;
	
		if (_inrange_payout) then
		{
			player setVariable ["cmoney", (player getVariable ["cmoney", 0]) + _money, true];
		}
		else 
		{ 
{'fraction_non_alphanumeric': 0.29829636772741885, 'fraction_numerical': 0.033751205400192864, 'mean_word_length': 4.950286806883366, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': 0}}
{'dir': 'git-commits-cleaned', 'id': '4730922', 'n_tokens_mistral': 1141, 'n_tokens_neox': 926, 'n_words': 259}