Skip to content

Commit d914978

Browse files
committed
ZH only changes.
1 parent 2e3ede1 commit d914978

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ static void doFindMostReadyWeaponForThing( Object *obj, void *userData )
13771377
return;
13781378
}
13791379

1380-
if( info->thing->isEquivalentTo( obj->getTemplate() ) )
1380+
if( info->thing && info->thing->isEquivalentTo( obj->getTemplate() ) )
13811381
{
13821382
if( !obj->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION )
13831383
&& !obj->testStatus( OBJECT_STATUS_SOLD )
@@ -1409,7 +1409,7 @@ static void doFindMostReadySpecialPowerForThing( Object *obj, void *userData )
14091409
return;
14101410
}
14111411

1412-
if( info->thing->isEquivalentTo( obj->getTemplate() ) )
1412+
if( info->thing && info->thing->isEquivalentTo( obj->getTemplate() ) )
14131413
{
14141414
if( !obj->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION )
14151415
&& !obj->testStatus( OBJECT_STATUS_SOLD )
@@ -1445,7 +1445,7 @@ static void doFindExistingObjectWithThingTemplate( Object *obj, void *userData )
14451445
return;
14461446
}
14471447

1448-
if( info->thing->isEquivalentTo( obj->getTemplate() ) )
1448+
if( info->thing && info->thing->isEquivalentTo( obj->getTemplate() ) )
14491449
{
14501450
if( !obj->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION )
14511451
&& !obj->testStatus( OBJECT_STATUS_SOLD )
@@ -2863,7 +2863,7 @@ static void countExisting( Object *obj, void *userData )
28632863
TypeCountData *typeCountData = (TypeCountData *)userData;
28642864

28652865
// Compare templates
2866-
if ( typeCountData->type->isEquivalentTo( obj->getTemplate() ) ||
2866+
if ( ( typeCountData->type && typeCountData->type->isEquivalentTo( obj->getTemplate() ) ) ||
28672867
( typeCountData->linkKey != NAMEKEY_INVALID && obj->getTemplate() != NULL && typeCountData->linkKey == obj->getTemplate()->getMaxSimultaneousLinkKey() ) )
28682868
{
28692869
typeCountData->count++;

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/RiderChangeContain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Bool RiderChangeContain::isValidContainerFor(const Object* rider, Bool checkCapa
170170
for( int i = 0; i < MAX_RIDERS; i++ )
171171
{
172172
const ThingTemplate *thing = TheThingFactory->findTemplate( data->m_riders[ i ].m_templateName );
173-
if( thing->isEquivalentTo( rider->getTemplate() ) )
173+
if( thing && thing->isEquivalentTo( rider->getTemplate() ) )
174174
{
175175
//We found a valid rider, so return success.
176176
return TRUE;
@@ -211,7 +211,7 @@ void RiderChangeContain::onContaining( Object *rider, Bool wasSelected )
211211
for( int i = 0; i < MAX_RIDERS; i++ )
212212
{
213213
const ThingTemplate *thing = TheThingFactory->findTemplate( data->m_riders[ i ].m_templateName );
214-
if( thing->isEquivalentTo( rider->getTemplate() ) )
214+
if( thing && thing->isEquivalentTo( rider->getTemplate() ) )
215215
{
216216

217217
//This is our rider, so set the correct model condition.
@@ -282,7 +282,7 @@ void RiderChangeContain::onRemoving( Object *rider )
282282
for( int i = 0; i < MAX_RIDERS; i++ )
283283
{
284284
const ThingTemplate *thing = TheThingFactory->findTemplate( data->m_riders[ i ].m_templateName );
285-
if( thing->isEquivalentTo( rider->getTemplate() ) )
285+
if( thing && thing->isEquivalentTo( rider->getTemplate() ) )
286286
{
287287
//This is our rider, so clear the current model condition.
288288
bike->clearModelConditionFlags( MAKE_MODELCONDITION_MASK2( data->m_riders[ i ].m_modelConditionFlagType, MODELCONDITION_DOOR_1_CLOSING ) );

0 commit comments

Comments
 (0)