// City Setup on server

_mkr = (EGG_EVO_MissionTowns select EGG_EVO_MissionProgress);
_pos = getMarkerPos _mkr;
EGG_EVO_DetectEast = createTrigger ["EmptyDetector", _pos];
EGG_EVO_DetectEast setTriggerActivation ["EAST", "PRESENT", true];
EGG_EVO_DetectEast setTriggerArea [500, 500, 0, true];
EGG_EVO_DetectEast setTriggerTimeout [2, 2, 2, true ];

EGG_EVO_DetectWest = createTrigger ["EmptyDetector", _pos];
EGG_EVO_DetectWest setTriggerActivation ["WEST", "PRESENT", true];
EGG_EVO_DetectWest setTriggerArea [600, 600, 0, true];
EGG_EVO_DetectWest setTriggerTimeout [2, 2, 2, true ];
_count = (count EGG_EVO_MissionTowns);

Sleep 2.0;

while {EGG_EVO_MissionProgress < _count} do
{
 	_mkr = (EGG_EVO_MissionTowns select EGG_EVO_MissionProgress);
 	_pos = getMarkerPos _mkr;
	
	EGG_EVO_DetectEast setpos _pos;
	EGG_EVO_DetectWest setpos _pos;
	Sleep 2.0;
//adding
	CityClear=false;
	_radio = (EGG_EVO_radios select EGG_EVO_MissionProgress);

	[_mkr,EGG_EVO_DetectEast,EGG_EVO_DetectWest,EGG_EVO_MissionProgress] call EGG_EVO_Erec;
	
	Sleep 10.0;

//testing reinforce - removed from sinit
	for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
	{
//adding
		if (not (alive _radio)) then 
		{
			if ("Man" countType list EGG_EVO_DetectEast <= 6) then
			{
				if ("Tank" countType list EGG_EVO_DetectEast  <= 2) then
				{
					if("Car" countType list EGG_EVO_DetectEast <= 2) then
					{
						if ("Land" countType list EGG_EVO_DetectWest > 0) then
						{
							_loop=1;
						};
					};
				};
			};
		};
		Sleep 4;
	};
	
	{_handle = [_x] execVM "scripts\makepow.sqf"} forEach (list EGG_EVO_DetectEast);
	
	{_x addscore EGG_EVO_cityscore} forEach (list EGG_EVO_DetectWest);
	
	EGG_EVO_MissionProgress = EGG_EVO_MissionProgress+1;
	publicVariable "EGG_EVO_MissionProgress";
};