Do not activate a radar detector before it has been completely built. Closes ticket:2202

master
Per Inge Mathisen 2010-10-22 19:56:48 +02:00
parent d8ec229ec6
commit 1e5c8a77e2
1 changed files with 2 additions and 2 deletions

View File

@ -3342,7 +3342,7 @@ SENSOR_STATS *objActiveRadar(BASE_OBJECT *psObj)
break;
case OBJ_STRUCTURE:
psStats = ((STRUCTURE *)psObj)->pStructureType->pSensor;
if (psStats == NULL || psStats->location != LOC_TURRET)
if (psStats == NULL || psStats->location != LOC_TURRET || ((STRUCTURE *)psObj)->status != SS_BUILT)
{
return NULL;
}
@ -3359,7 +3359,7 @@ bool objRadarDetector(BASE_OBJECT *psObj)
{
STRUCTURE *psStruct = (STRUCTURE *)psObj;
return (psStruct->pStructureType->pSensor && psStruct->pStructureType->pSensor->type == RADAR_DETECTOR_SENSOR);
return (psStruct->status == SS_BUILT && psStruct->pStructureType->pSensor && psStruct->pStructureType->pSensor->type == RADAR_DETECTOR_SENSOR);
}
else if (psObj->type == OBJ_DROID)
{