Fix segfault when trying to read target of droid with no target in aiUpdateStructure.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7927 4a71c877-e1ca-e34f-864e-861f7616d084
master
Guangcong Luo 2009-08-02 23:12:29 +00:00 committed by Git SVN Gateway
parent f69561117e
commit d1bf617727
1 changed files with 1 additions and 1 deletions

View File

@ -3106,7 +3106,7 @@ static void aiUpdateStructure(STRUCTURE *psStructure, bool mission)
}
// Second highest priority:
// Help out another nearby repair facility
else if (mindist > (TILE_UNITS*8)*(TILE_UNITS*8)
else if (psTarget && mindist > (TILE_UNITS*8)*(TILE_UNITS*8)
&& psTarget != (BASE_OBJECT *)psStructure && psDroid->action == DACTION_WAITFORREPAIR)
{
REPAIR_FACILITY *stealFrom = &((STRUCTURE *)psTarget)->pFunctionality->repairFacility;