Fixed the collision-caused segfault.

This commit is contained in:
Julie Marchant 2019-06-13 12:02:42 -04:00
parent f43c81ec07
commit 9b782de4e4
1 changed files with 3 additions and 1 deletions

View File

@ -1809,7 +1809,9 @@ void alien_move(Object *alien)
{ {
for (int i = 0 ; i < ALIEN_MAX ; i++) for (int i = 0 ; i < ALIEN_MAX ; i++)
{ {
if (ship_collision(alien, &aliens[i]) && (aliens[i].owner != alien)) if ((aliens[i].owner != alien) && (aliens[i].active) &&
(aliens[i].shield > 0) && (!(aliens[i].flags & FL_LEAVESECTOR)) &&
ship_collision(alien, &aliens[i]))
{ {
if ((game.difficulty == DIFFICULTY_ORIGINAL) && (alien->classDef != CD_DRONE) && if ((game.difficulty == DIFFICULTY_ORIGINAL) && (alien->classDef != CD_DRONE) &&
(alien->classDef != CD_ASTEROID) && (alien->classDef != CD_ASTEROID2) && (alien->classDef != CD_ASTEROID) && (alien->classDef != CD_ASTEROID2) &&