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
parent
ccb286ceaa
commit
18cf896eb7
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue