Index: src/stats.c
===================================================================
--- src/stats.c	(revision 6904)
+++ src/stats.c	(working copy)
@@ -1176,6 +1176,10 @@
 		{
 			psStats->type = SUPER_SENSOR;
 		}
+		else if (!strcmp(type, "RADAR DETECTOR"))
+		{
+			psStats->type = RADAR_DETECTOR_SENSOR;
+		}
 		else
 		{
 			ASSERT( false, "Invalid Sensor type" );
@@ -3357,3 +3361,47 @@
 
 	return false;
 }
+
+SENSOR_STATS *objActiveRadar(BASE_OBJECT *psObj)
+{
+	SENSOR_STATS	*psStats = NULL;
+
+	switch (psObj->type)
+	{
+	case OBJ_DROID:
+		if (((DROID *)psObj)->droidType != DROID_SENSOR && ((DROID *)psObj)->droidType != DROID_COMMAND)
+		{
+			return NULL;
+		}
+		psStats = asSensorStats + ((DROID *)psObj)->asBits[COMP_SENSOR].nStat;
+		break;
+	case OBJ_STRUCTURE:
+		psStats = ((STRUCTURE *)psObj)->pStructureType->pSensor;
+		if (psStats == NULL || psStats->location != LOC_TURRET)
+		{
+			return NULL;
+		}
+		break;
+	default:
+		break;
+	}
+	return psStats;
+}
+
+bool objRadarDetector(BASE_OBJECT *psObj)
+{
+	if (psObj->type == OBJ_STRUCTURE)
+	{
+		STRUCTURE *psStruct = (STRUCTURE *)psObj;
+
+		return (psStruct->pStructureType->pSensor && psStruct->pStructureType->pSensor->type == RADAR_DETECTOR_SENSOR);
+	}
+	else if (psObj->type == OBJ_DROID)
+	{
+		DROID *psDroid = (DROID *)psObj;
+		SENSOR_STATS *psSensor = getSensorStats(psDroid);
+
+		return (psSensor && psSensor->type == RADAR_DETECTOR_SENSOR);
+	}
+	return false;
+}
Index: src/stats.h
===================================================================
--- src/stats.h	(revision 6904)
+++ src/stats.h	(working copy)
@@ -361,4 +361,12 @@
 
 extern void statsInitVars(void);
 
+/* Wrappers */
+
+/** If object is an active radar (has sensor turret), then return a pointer to its sensor stats. If not, return NULL. */
+SENSOR_STATS *objActiveRadar(BASE_OBJECT *psObj);
+
+/** Returns whether object has a radar detector sensor. */
+bool objRadarDetector(BASE_OBJECT *psObj);
+
 #endif // __INCLUDED_SRC_STATS_H__
Index: src/display.c
===================================================================
--- src/display.c	(revision 6904)
+++ src/display.c	(working copy)
@@ -2708,8 +2708,6 @@
 		}
 	}
 
-//DBPRINTF(("%d %d\n",mouseTileX,mouseTileY);
-
 	/* We haven't found anything yet */
 	retVal = MT_NOTARGET;
 
@@ -2725,7 +2723,6 @@
 					// need to check for command droids here as well
 					if (psDroid->droidType == DROID_SENSOR)
 					{
-//	DBPRINTF(("MT_SENSOR\n");
 						return MT_SENSOR;
 					}
 					else if (psDroid->droidType == DROID_TRANSPORTER)
Index: src/action.c
===================================================================
--- src/action.c	(revision 6904)
+++ src/action.c	(working copy)
@@ -2133,7 +2133,7 @@
 		// align the turret
 		actionTargetTurret((BASE_OBJECT*)psDroid, psDroid->psActionTarget[0], &psDroid->asWeaps[0]);
 
-		if (cbSensorDroid(psDroid))
+		if (cbSensorDroid(psDroid) || objRadarDetector((BASE_OBJECT *)psDroid))
 		{
 			// don't move to the target, just make sure it is visible
 			// Anyone commenting this out will get a knee capping from John.
@@ -2655,7 +2655,7 @@
 		psDroid->actionX = psDroid->pos.x;
 		psDroid->actionY = psDroid->pos.y;
 		if (//(secondaryGetState(psDroid, DSO_HALTTYPE, &state) && (state == DSS_HALT_HOLD)) ||
-			cbSensorDroid(psDroid))
+			cbSensorDroid(psDroid) || objRadarDetector((BASE_OBJECT *)psDroid))
 		{
 			psDroid->action = DACTION_OBSERVE;
 		}
Index: src/structure.c
===================================================================
--- src/structure.c	(revision 6904)
+++ src/structure.c	(working copy)
@@ -2853,7 +2853,7 @@
 	/* See if there is an enemy to attack for Sensor Towers that have weapon droids attached*/
 	else if (psStructure->pStructureType->pSensor)
 	{
-		if (structStandardSensor(psStructure) || structVTOLSensor(psStructure))
+		if (structStandardSensor(psStructure) || structVTOLSensor(psStructure) || objRadarDetector((BASE_OBJECT *)psStructure))
 		{
 			if ((psStructure->id % 20) == (frameGetFrameNumber() % 20))
 			{
@@ -2878,7 +2878,7 @@
 		// you can always see anything that a CB sensor is targeting
 		// Anyone commenting this out again will get a knee capping from John.
 		// You have been warned!!
-		if ((structCBSensor(psStructure) || structVTOLCBSensor(psStructure)) &&
+		if ((structCBSensor(psStructure) || structVTOLCBSensor(psStructure) || objRadarDetector((BASE_OBJECT *)psStructure)) &&
 			psStructure->psTarget[0] != NULL)
 		{
 			psStructure->psTarget[0]->visible[psStructure->player] = UBYTE_MAX;
@@ -5837,7 +5837,8 @@
 		       || psStructure->pStructureType->pSensor->type == INDIRECT_CB_SENSOR
 		       || psStructure->pStructureType->pSensor->type == VTOL_INTERCEPT_SENSOR
 		       || psStructure->pStructureType->pSensor->type == VTOL_CB_SENSOR
-		       || psStructure->pStructureType->pSensor->type == SUPER_SENSOR)
+		       || psStructure->pStructureType->pSensor->type == SUPER_SENSOR
+		       || psStructure->pStructureType->pSensor->type == RADAR_DETECTOR_SENSOR)
 		       && psStructure->pStructureType->pSensor->location == LOC_TURRET)
 		{
 			unsigned int assigned_droids = countAssignedDroids(psStructure);
Index: src/stats-db2.tpl
===================================================================
--- src/stats-db2.tpl	(revision 6904)
+++ src/stats-db2.tpl	(working copy)
@@ -277,6 +277,9 @@
 
     # Works as all of the above together! - new for updates
     SUPER
+
+    %string "RADAR DETECTOR";
+    RADAR_DETECTOR
 end;
 
 struct SENSOR
Index: src/droid.c
===================================================================
--- src/droid.c	(revision 6904)
+++ src/droid.c	(working copy)
@@ -4580,13 +4580,10 @@
 		return false;
 	}
 
-	//check indirect weapon droid with standard/cb sensor
-    /*Super Sensor works as any type*/
+	// Check indirect weapon droid with standard/CB/radar detector sensor
 	if (!proj_Direct(asWeaponStats + psDroid->asWeaps[0].nStat))
 	{
-		if (psStats->type == STANDARD_SENSOR ||
-			psStats->type == INDIRECT_CB_SENSOR ||
-            psStats->type == SUPER_SENSOR)
+		if (psStats->type == STANDARD_SENSOR ||	psStats->type == INDIRECT_CB_SENSOR || psStats->type == SUPER_SENSOR || psStats->type == RADAR_DETECTOR_SENSOR)
 		{
 			return true;
 		}
Index: src/visibility.c
===================================================================
--- src/visibility.c	(revision 6904)
+++ src/visibility.c	(working copy)
@@ -321,12 +321,18 @@
 	{
 		case OBJ_DROID:
 		{
-			const DROID * psDroid = (DROID *)psViewer;
+			DROID *psDroid = (DROID *)psViewer;
 
 			if (psDroid->droidType == DROID_COMMAND)
 			{
 				range = 3 * range / 2;
 			}
+			if (psDroid->psTarget == psTarget
+			    && (cbSensorDroid(psDroid) || objRadarDetector((BASE_OBJECT *)psDroid)))
+			{
+				// if it is targetted by a counter battery sensor, it is seen
+				return UBYTE_MAX;
+			}
 			break;
 		}
 		case OBJ_STRUCTURE:
@@ -345,9 +351,8 @@
 				return 0;
 			}
 
-			if ((structCBSensor(psStruct)
-				|| structVTOLCBSensor(psStruct))
-				&& psStruct->psTarget[0] == psTarget)
+			if (psStruct->psTarget[0] == psTarget
+			    && (structCBSensor(psStruct) || structVTOLCBSensor(psStruct) || objRadarDetector((BASE_OBJECT *)psStruct)))
 			{
 				// if a unit is targetted by a counter battery sensor
 				// it is automatically seen
Index: src/ai.c
===================================================================
--- src/ai.c	(revision 6904)
+++ src/ai.c	(working copy)
@@ -581,7 +581,6 @@
 	BOOL			bCBTower;
 	STRUCTURE		*psCStruct;
 	DROID			*psCommander;
-	BOOL			bCommanderBlock;
 	SECONDARY_STATE		state;
 	SDWORD			curTargetWeight=-1;
 
@@ -643,6 +642,7 @@
 	{
 		WEAPON_STATS	*psWStats = NULL;
 		int	longRange = 0;
+		BOOL	bCommanderBlock = false;
 
 		ASSERT(((STRUCTURE *)psObj)->asWeaps[weapon_slot].nStat > 0, "no weapons on structure");
 
@@ -652,7 +652,6 @@
 		// see if there is a target from the command droids
 		psTarget = NULL;
 		psCommander = cmdDroidGetDesignator(psObj->player);
-		bCommanderBlock = false;
 		if (!proj_Direct(psWStats) && (psCommander != NULL) &&
 			aiStructHasRange((STRUCTURE *)psObj, (BASE_OBJECT *)psCommander, weapon_slot))
 		{
@@ -713,7 +712,7 @@
 					    }
 					}
 				}
-				else if (structCBSensor(psCStruct)
+				else if ((structCBSensor(psCStruct) || objRadarDetector((BASE_OBJECT *)psCStruct))
 				         && psCStruct->psTarget[0] != NULL
 				         && !psCStruct->psTarget[0]->died)
 				{
@@ -780,81 +779,105 @@
 /* See if there is a target in range for Sensor objects*/
 BOOL aiChooseSensorTarget(BASE_OBJECT *psObj, BASE_OBJECT **ppsTarget)
 {
-	SDWORD	sensorRange = objSensorRange(psObj);
-	UDWORD	radSquared;
-	BASE_OBJECT		*psCurr,*psTemp = NULL;
-	BASE_OBJECT		*psTarget = NULL;
-	SDWORD	xdiff,ydiff, distSq, tarDist;
+	int		sensorRange = objSensorRange(psObj);
+	unsigned int	radSquared = sensorRange * sensorRange;
+	bool		radarDetector = objRadarDetector(psObj);
 
-	/* Get the sensor range */
-	switch (psObj->type)
+	if (!objActiveRadar(psObj) && !radarDetector)
 	{
-	case OBJ_DROID:
-		if (asSensorStats[((DROID *)psObj)->asBits[COMP_SENSOR].nStat].
-			location != LOC_TURRET)
+		ASSERT(false, "Only to be used for sensor turrets!");
+		return false;
+	}
+
+	/* See if there is something in range */
+	if (radarDetector)
+	{
+		BASE_OBJECT	*psCurr, *psTemp = NULL;
+		int		tarDist = SDWORD_MAX;
+
+		gridStartIterate((SDWORD)psObj->pos.x, (SDWORD)psObj->pos.y);
+		psCurr = gridIterate();
+		while (psCurr != NULL)
 		{
-			// to be used for Turret Sensors only
-			return false;
+			if (psCurr->type == OBJ_STRUCTURE || psCurr->type == OBJ_DROID)
+			{
+				if (psObj->player != psCurr->player
+				    && !aiCheckAlliances(psCurr->player,psObj->player)
+				    && objActiveRadar(psCurr))
+				{
+					// See if in twice *their* sensor range
+					const int xdiff = psCurr->pos.x - psObj->pos.x;
+					const int ydiff = psCurr->pos.y - psObj->pos.y;
+					const unsigned int distSq = xdiff * xdiff + ydiff * ydiff;
+					const int targetSensor = objSensorRange(psCurr) * 2;
+					const unsigned int sensorSquared = targetSensor * targetSensor;
+
+					if (distSq < sensorSquared && distSq < tarDist)
+					{
+						psTemp = psCurr;
+						tarDist = distSq;
+					}
+				}
+			}
+			psCurr = gridIterate();
 		}
-		radSquared = sensorRange * sensorRange;
-		break;
-	case OBJ_STRUCTURE:
-		if (!(structStandardSensor((STRUCTURE *)psObj) ||
-			structVTOLSensor((STRUCTURE *)psObj)))
+
+		if (psTemp)
 		{
-			// to be used for Standard and VTOL intercept Turret Sensors only
-			return false;
+			objTrace(psTemp->id, "Targetted by radar detector %d", (int)psObj->id);
+			objTrace(psObj->id, "Targetting radar %d", (int)psTemp->id);
+			ASSERT(!psTemp->died, "aiChooseSensorTarget gave us a dead target");
+			*ppsTarget = psTemp;
+			return true;
 		}
-		radSquared = sensorRange * sensorRange;
-		break;
-	default:
-		radSquared = 0;
-		break;
 	}
+	else if (psObj->type == OBJ_DROID && CAN_UPDATE_NAYBORS((DROID *)psObj))
+	{
+		BASE_OBJECT	*psTarget = NULL;
 
-	/* See if there is a something in range */
-	if (psObj->type == OBJ_DROID && CAN_UPDATE_NAYBORS( (DROID *)psObj ))
-	{
 		if (aiBestNearestTarget((DROID *)psObj, &psTarget, 0) >= 0)
 		{
 			/* See if in sensor range */
-			xdiff = psTarget->pos.x - psObj->pos.x;
-			ydiff = psTarget->pos.y - psObj->pos.y;
-			if (xdiff*xdiff + ydiff*ydiff < (SDWORD)radSquared)
+			const int xdiff = psTarget->pos.x - psObj->pos.x;
+			const int ydiff = psTarget->pos.y - psObj->pos.y;
+			const unsigned int distSq = xdiff * xdiff + ydiff * ydiff;
+
+			if (distSq < radSquared)
 			{
 				*ppsTarget = psTarget;
 				return true;
 			}
 		}
 	}
-	else
+	else	// structure
 	{
-		tarDist = SDWORD_MAX;
+		BASE_OBJECT	*psCurr, *psTemp = NULL;
+		int		tarDist = SDWORD_MAX;
+
 		gridStartIterate((SDWORD)psObj->pos.x, (SDWORD)psObj->pos.y);
 		psCurr = gridIterate();
 		while (psCurr != NULL)
 		{
-			    //don't target features
-			    if (psCurr->type != OBJ_FEATURE && !psCurr->died)
-			    {
-				    if (psObj->player != psCurr->player &&
-					    !aiCheckAlliances(psCurr->player,psObj->player) &&
-					    !aiObjIsWall(psCurr))
-				    {
-					    // See if in sensor range and visible
-					    xdiff = psCurr->pos.x - psObj->pos.x;
-					    ydiff = psCurr->pos.y - psObj->pos.y;
-					    distSq = xdiff*xdiff + ydiff*ydiff;
-					    if (distSq < (SDWORD)radSquared &&
-						    psCurr->visible[psObj->player] &&
-						    distSq < tarDist)
-					    {
-						    psTemp = psCurr;
-						    tarDist = distSq;
-					    }
-				    }
-			    }
-			    psCurr = gridIterate();
+			// Don't target features or dead objects
+			if (psCurr->type != OBJ_FEATURE && !psCurr->died)
+			{
+				if (psObj->player != psCurr->player &&
+				    !aiCheckAlliances(psCurr->player,psObj->player) &&
+				    !aiObjIsWall(psCurr))
+				{
+					// See if in sensor range and visible
+					const int xdiff = psCurr->pos.x - psObj->pos.x;
+					const int ydiff = psCurr->pos.y - psObj->pos.y;
+					const unsigned int distSq = xdiff * xdiff + ydiff * ydiff;
+
+					if (distSq < radSquared && psCurr->visible[psObj->player] && distSq < tarDist)
+					{
+						psTemp = psCurr;
+						tarDist = distSq;
+					}
+				}
+			}
+			psCurr = gridIterate();
 		}
 
 		if (psTemp)
@@ -1021,8 +1044,7 @@
 	{
 		if (psDroid->droidType == DROID_SENSOR)
 		{
-			//Watermelon:only 1 target for sensor droid
-			if ( aiChooseTarget((BASE_OBJECT *)psDroid, &psTarget, 0, true) )
+			if (aiChooseSensorTarget((BASE_OBJECT *)psDroid, &psTarget))
 			{
 				orderDroidObj(psDroid, DORDER_OBSERVE, psTarget);
 			}
Index: data/mp/stats/sensor.txt
===================================================================
--- data/mp/stats/sensor.txt	(revision 6904)
+++ data/mp/stats/sensor.txt	(working copy)
@@ -1,9 +1,9 @@
 ZNULLSENSOR,Level All,1,1,1,1,1,1,gnlsnsr1.PIE,trlsnsr1.PIE,1024,DEFAULT,STANDARD,0,500,0
 UplinkSensor,Level All,1,1,1,1,1,200,miupdish.PIE,TRLSNSR1.PIE,2304,TURRET,SUPER,0,1000,0
-Sys-VTOLRadarTower01,Level Two-Three,20,100,100,0,0,200,GNMSNSR2.PIE,TRMECM2.PIE,2048,TURRET,VTOL INTERCEPT,0,1000,0
+Sys-VTOLRadarTower01,Level Two-Three,20,100,100,0,0,200,GNMSNSR2.PIE,TRMECM2.PIE,1024,TURRET,RADAR DETECTOR,0,1000,0
 Sys-VTOLCBTurret01,Level Two-Three,20,100,100,0,0,200,GNHSNSR3.PIE,TRHSNSR3.PIE,2048,TURRET,VTOL CB,0,1000,1
 Sys-VTOLCBTower01,Level Two-Three,20,100,100,0,0,200,GNHSNSR3.PIE,TRHSNSR3.PIE,2048,TURRET,VTOL CB,0,1000,0
-Sys-VstrikeTurret01,Level All,20,100,100,0,0,0,GNMSNSR2.PIE,TRLSNSR1.PIE,2048,TURRET,VTOL INTERCEPT,0,1000,1
+Sys-VstrikeTurret01,Level All,20,100,100,0,0,0,GNMSNSR2.PIE,TRLSNSR1.PIE,1024,TURRET,RADAR DETECTOR,0,1000,1
 Sys-NXLinkTurret01,Level Three,20,100,100,0,0,200,GNMECM2.PIE,TRMSNSR2.PIE,2048,TURRET,STANDARD,0,1000,1
 Sys-CBTurret01,Level All,20,100,100,0,0,200,GNMECM2.PIE,TRMSNSR2.PIE,2048,TURRET,INDIRECT CB,0,1000,1
 Sys-CBTower01,Level All,20,100,100,0,0,200,GNMECM2.PIE,TRMSNSR2.PIE,2048,TURRET,INDIRECT CB,0,1000,0

