Skip to content

Commit bf058bb

Browse files
committed
Do not activate a radar detector before it has been completely built. Closes ticket:2202
1 parent 0f3bfba commit bf058bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stats.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3342,7 +3342,7 @@ SENSOR_STATS *objActiveRadar(BASE_OBJECT *psObj)
33423342
break;
33433343
case OBJ_STRUCTURE:
33443344
psStats = ((STRUCTURE *)psObj)->pStructureType->pSensor;
3345-
if (psStats == NULL || psStats->location != LOC_TURRET)
3345+
if (psStats == NULL || psStats->location != LOC_TURRET || ((STRUCTURE *)psObj)->status != SS_BUILT)
33463346
{
33473347
return NULL;
33483348
}
@@ -3359,7 +3359,7 @@ bool objRadarDetector(BASE_OBJECT *psObj)
33593359
{
33603360
STRUCTURE *psStruct = (STRUCTURE *)psObj;
33613361

3362-
return (psStruct->pStructureType->pSensor && psStruct->pStructureType->pSensor->type == RADAR_DETECTOR_SENSOR);
3362+
return (psStruct->status == SS_BUILT && psStruct->pStructureType->pSensor && psStruct->pStructureType->pSensor->type == RADAR_DETECTOR_SENSOR);
33633363
}
33643364
else if (psObj->type == OBJ_DROID)
33653365
{

0 commit comments

Comments
 (0)