Fix a crash related to corrupt templates. Fixes bug #1012.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8597 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
5ba89a0f93
commit
bf366b2527
|
@ -6177,8 +6177,8 @@ BOOL validTemplateForFactory(DROID_TEMPLATE *psTemplate, STRUCTURE *psFactory)
|
|||
}
|
||||
}
|
||||
//check for VTOL droid
|
||||
else if ((asPropulsionStats + psTemplate->asParts[COMP_PROPULSION])->
|
||||
propulsionType == PROPULSION_TYPE_LIFT)
|
||||
else if (psTemplate->asParts[COMP_PROPULSION] &&
|
||||
((asPropulsionStats + psTemplate->asParts[COMP_PROPULSION])->propulsionType == PROPULSION_TYPE_LIFT))
|
||||
{
|
||||
if (psFactory->pStructureType->type != REF_VTOL_FACTORY)
|
||||
{
|
||||
|
@ -6201,8 +6201,8 @@ BOOL validTemplateForFactory(DROID_TEMPLATE *psTemplate, STRUCTURE *psFactory)
|
|||
//check if vtol factory
|
||||
else if (psFactory->pStructureType->type == REF_VTOL_FACTORY)
|
||||
{
|
||||
if ((asPropulsionStats + psTemplate->asParts[COMP_PROPULSION])->
|
||||
propulsionType != PROPULSION_TYPE_LIFT)
|
||||
if (!psTemplate->asParts[COMP_PROPULSION] ||
|
||||
((asPropulsionStats + psTemplate->asParts[COMP_PROPULSION])->propulsionType != PROPULSION_TYPE_LIFT))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue