<commit_before>#include "macros.hpp"
AS_SERVER_ONLY("spawnLoop.sqf");

private _tiempo = time;

while {true} do {
	// maintain a rate of checks of "AS_spawnLoopTime" seconds.
	sleep AS_spawnLoopTime;
	//if (time - _tiempo >= AS_spawnLoopTime) then {sleep (AS_spawnLoopTime/5)} else {sleep (AS_spawnLoopTime - (time - _tiempo))};
	//_tiempo = time;

	waitUntil {!isNil "AS_commander"};

	// get units that spawn locations
	private _spawningBLUFORunits = [];
	private _spawningOPFORunits = [];
	{
		if (_x getVariable ["BLUFORSpawn",false]) then {
			_spawningBLUFORunits pushBack _x;
			if (isPlayer _x) then {
				if (!isNull (getConnectedUAV _x)) then {
					_spawningBLUFORunits pushBack (getConnectedUAV _x);
				};
			};
		} else {
			if (_x getVariable ["OPFORSpawn",false]) then {
				_spawningOPFORunits pushBack _x;
			};
		};
	} forEach allUnits;

	// check whether a location is spawned or not
	{ // forEach location
		private _position = _x call AS_fnc_location_position;
		private _isSpawned = _x call AS_fnc_location_spawned;

		if (_x call AS_fnc_location_side == "AAF") then {
			private _spawnCondition = (_x call AS_fnc_location_forced_spawned) or {{(_x distance _position < AS_P("spawnDistance"))} count _spawningBLUFORunits > 0};			                          ;
			if (!_isSpawned and _spawnCondition) then {
				_x call AS_fnc_location_spawn;
				private _type = _x call AS_fnc_location_type;
				switch (true) do {
					case (_type == "hill"): {[[_x], "createWatchpost"] call AS_scheduler_fnc_execute};
					case (_type == "hillAA"): {[[_x], "createAAsite"] call AS_scheduler_fnc_execute};
					case (_type == "city"): {
						[[_x], "createCIV"] call AS_scheduler_fnc_execute;
						[[_x], "createCity"] call AS_scheduler_fnc_execute;
					};
					case (_type in ["resource", "powerplant", "factory"]): {
						[[_x], "AS_fnc_createAAFgeneric"] call AS_scheduler_fnc_execute;
					};
					case (_type == "base"): {[[_x], "createBase"] call AS_scheduler_fnc_execute};
					case (_type == "roadblock"): {[[_x], "createRoadblock"] call AS_scheduler_fnc_execute};
					case (_type == "airfield"): {[[_x], "createAirbase"] call AS_scheduler_fnc_execute};
					case (_type in ["outpost", "seaport"]): {[[_x], "createOutpost"] call AS_scheduler_fnc_execute};
					case (_type == "outpostAA"): {[[_x], "createOutpostAA"] call AS_scheduler_fnc_execute};
					case (_type == "minefield"): {[[_x], "AS_fnc_createMinefield"] call AS_scheduler_fnc_execute};
				};
			};
			if (_isSpawned and !_spawnCondition) then {
				_x call AS_fnc_location_despawn;
			};
		};
		if (_x call AS_fnc_location_side == "FIA") then {
			// not clear what this is doing. owner is about who controls it, not something else.
			private _playerIsClose = (_x call AS_fnc_location_forced_spawned) or
							         {{((_x getVariable ["owner", _x]) == _x) and {_x distance _position < AS_P("spawnDistance")}} count _spawningBLUFORunits > 0};<commit_msg>Removed unnecessary spaces<commit_after>#include "macros.hpp"
AS_SERVER_ONLY("spawnLoop.sqf");

private _tiempo = time;

while {true} do {
	// maintain a rate of checks of "AS_spawnLoopTime" seconds.
	sleep AS_spawnLoopTime;
	//if (time - _tiempo >= AS_spawnLoopTime) then {sleep (AS_spawnLoopTime/5)} else {sleep (AS_spawnLoopTime - (time - _tiempo))};
	//_tiempo = time;

	waitUntil {!isNil "AS_commander"};

	// get units that spawn locations
	private _spawningBLUFORunits = [];
	private _spawningOPFORunits = [];
	{
		if (_x getVariable ["BLUFORSpawn",false]) then {
			_spawningBLUFORunits pushBack _x;
			if (isPlayer _x) then {
				if (!isNull (getConnectedUAV _x)) then {
					_spawningBLUFORunits pushBack (getConnectedUAV _x);
				};
			};
		} else {
			if (_x getVariable ["OPFORSpawn",false]) then {
				_spawningOPFORunits pushBack _x;
			};
		};
	} forEach allUnits;

	// check whether a location is spawned or not
	{ // forEach location
		private _position = _x call AS_fnc_location_position;
		private _isSpawned = _x call AS_fnc_location_spawned;

		if (_x call AS_fnc_location_side == "AAF") then {
			private _spawnCondition = (_x call AS_fnc_location_forced_spawned) or {{(_x distance _position < AS_P("spawnDistance"))} count _spawningBLUFORunits > 0};
			if (!_isSpawned and _spawnCondition) then {
				_x call AS_fnc_location_spawn;
				private _type = _x call AS_fnc_location_type;
				switch (true) do {
					case (_type == "hill"): {[[_x], "createWatchpost"] call AS_scheduler_fnc_execute};
					case (_type == "hillAA"): {[[_x], "createAAsite"] call AS_scheduler_fnc_execute};
					case (_type == "city"): {
						[[_x], "createCIV"] call AS_scheduler_fnc_execute;
						[[_x], "createCity"] call AS_scheduler_fnc_execute;
					};
					case (_type in ["resource", "powerplant", "factory"]): {
						[[_x], "AS_fnc_createAAFgeneric"] call AS_scheduler_fnc_execute;
					};
					case (_type == "base"): {[[_x], "createBase"] call AS_scheduler_fnc_execute};
					case (_type == "roadblock"): {[[_x], "createRoadblock"] call AS_scheduler_fnc_execute};
					case (_type == "airfield"): {[[_x], "createAirbase"] call AS_scheduler_fnc_execute};
					case (_type in ["outpost", "seaport"]): {[[_x], "createOutpost"] call AS_scheduler_fnc_execute};
					case (_type == "outpostAA"): {[[_x], "createOutpostAA"] call AS_scheduler_fnc_execute};
					case (_type == "minefield"): {[[_x], "AS_fnc_createMinefield"] call AS_scheduler_fnc_execute};
				};
			};
			if (_isSpawned and !_spawnCondition) then {
				_x call AS_fnc_location_despawn;
			};
		};
		if (_x call AS_fnc_location_side == "FIA") then {
			// not clear what this is doing. owner is about who controls it, not something else.
			private _playerIsClose = (_x call AS_fnc_location_forced_spawned) or
							         {{((_x getVariable ["owner", _x]) == _x) and {_x distance _position < AS_P("spawnDistance")}} count _spawningBLUFORunits > 0};
{'fraction_non_alphanumeric': 0.13359494966729227, 'fraction_numerical': 0.0010237160894045385, 'mean_word_length': 4.233928571428572, 'pattern_counts': {'":': 0, '<': 7, '<?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': 0}}
{'dir': 'git-commits-cleaned', 'id': '3478333', 'n_tokens_mistral': 2370, 'n_tokens_neox': 2107, 'n_words': 519}