Skip to content

Commit

Permalink
Level 9: Fix infinite respawn of ghost ants trapped in liquids
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed Jan 7, 2023
1 parent 7acd6a1 commit 8b9befd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/Enemies/Enemy_Ant.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,23 +640,22 @@ float fps = gFramesPerSecondFrac;

/* DO ENEMY COLLISION */

if (DoEnemyCollisionDetect(theNode,DEATH_ENEMY_COLLISION_CTYPES))
if (DoEnemyCollisionDetect(theNode, DEATH_ENEMY_COLLISION_CTYPES | CTYPE_LIQUID))
return;

/*********************/
/* SEE IF MAKE GHOST */
/*********************/

if (gLevelType == LEVEL_TYPE_ANTHILL)
if (gLevelType == LEVEL_TYPE_ANTHILL
&& !theNode->MadeGhost
&& !(theNode->StatusBits & STATUS_BIT_UNDERWATER)) // avoid endless respawn if underwater (ghosts also die in water)
{
if (!theNode->MadeGhost)
theNode->DeathTimer += fps;
if (theNode->DeathTimer > .5f)
{
theNode->DeathTimer += fps;
if (theNode->DeathTimer > .5f)
{
theNode->MadeGhost = true;
MakeGhostAnt(theNode,&gCoord);
}
theNode->MadeGhost = true;
MakeGhostAnt(theNode,&gCoord);
}
}

Expand Down

0 comments on commit 8b9befd

Please sign in to comment.