Check if a structure has a sensor before reading info from it. Fixes crash in threat map code when dealing

with lassats. (Of course lassats do things differently than everything else.) Bug found by Cyp.
master
Per Inge Mathisen 2010-10-19 20:23:04 +02:00
parent ccb286ceaa
commit 18cf896eb7
1 changed files with 1 additions and 1 deletions

View File

@ -2255,7 +2255,7 @@ static void threatUpdate(int player)
{
mode |= asWeaponStats[psStruct->asWeaps[weapon].nStat].surfaceToAir;
}
if (psStruct->pStructureType->pSensor->location == LOC_TURRET) // special treatment for sensor turrets
if (psStruct->pStructureType->pSensor && psStruct->pStructureType->pSensor->location == LOC_TURRET) // special treatment for sensor turrets
{
mode |= SHOOT_ON_GROUND; // assume it only shoots at ground targets for now
}