Skip to content

Commit

Permalink
Check if a structure has a sensor before reading info from it. Fixes …
Browse files Browse the repository at this point in the history
…crash in threat map code when dealing

with lassats. (Of course lassats do things differently than everything else.) Bug found by Cyp.
  • Loading branch information
perim committed Oct 19, 2010
1 parent ccb286c commit 18cf896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/map.c
Expand Up @@ -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
}
Expand Down

0 comments on commit 18cf896

Please sign in to comment.