Skip to content

Commit

Permalink
Make sure pointer is valid before using it.
Browse files Browse the repository at this point in the history
refs ticket:2171

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/branches/2.3@11698 4a71c877-e1ca-e34f-864e-861f7616d084
(cherry picked from commit 4853171)

Conflicts:

	src/structure.c
  • Loading branch information
buginator committed Oct 19, 2010
1 parent ec18ac9 commit 5f83b41
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/structure.c
Expand Up @@ -6780,9 +6780,17 @@ void hqReward(UBYTE losingPlayer, UBYTE rewardPlayer)
//
BOOL StructIsFactory(STRUCTURE *Struct)
{
return Struct->pStructureType->type == REF_FACTORY ||
Struct->pStructureType->type == REF_CYBORG_FACTORY ||
Struct->pStructureType->type == REF_VTOL_FACTORY;
ASSERT_OR_RETURN(false, Struct != NULL, "Invalid structure!");
ASSERT_OR_RETURN(false, Struct->pStructureType != NULL, "Invalid structureType!");

if( (Struct->pStructureType->type == REF_FACTORY) ||
(Struct->pStructureType->type == REF_CYBORG_FACTORY) ||
(Struct->pStructureType->type == REF_VTOL_FACTORY) )
{
return true;
}

return false;
}


Expand Down

0 comments on commit 5f83b41

Please sign in to comment.