Skip to content

Commit 2940669

Browse files
authored
[GEN][ZH] Fix game crash in AIGroup::friend_moveFormationToPos() (#988)
1 parent 15319af commit 2940669

File tree

2 files changed

+10
-0
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameLogic/AI
  • Generals/Code/GameEngine/Source/GameLogic/AI

2 files changed

+10
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,11 @@ void AIGroup::friend_moveFormationToPos( const Coord3D *pos, CommandSourceType c
10891089
}
10901090
Object *theUnit = (*i);
10911091
AIUpdateInterface *ai = theUnit->getAIUpdateInterface();
1092+
if (ai == NULL)
1093+
{
1094+
continue;
1095+
}
1096+
10921097
Bool isDifferentFormation = false;
10931098
Coord2D offset;
10941099
if (isDifferentFormation) {

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,11 @@ void AIGroup::friend_moveFormationToPos( const Coord3D *pos, CommandSourceType c
10941094
}
10951095
Object *theUnit = (*i);
10961096
AIUpdateInterface *ai = theUnit->getAIUpdateInterface();
1097+
if (ai == NULL)
1098+
{
1099+
continue;
1100+
}
1101+
10971102
Bool isDifferentFormation = false;
10981103
Coord2D offset;
10991104
if (isDifferentFormation) {

0 commit comments

Comments
 (0)