Commit 58aa447e authored by Richard Gobeille's avatar Richard Gobeille

Duke3d: fix longstanding bug with unfrozen GREENSLIME

This fixes some undefined behavior that occurred as a result of reading far past the bounds of slimeFrames[].
parent e4f787ec
......@@ -4697,7 +4697,7 @@ ACTOR_STATIC void G_MoveActors(void)
if (pData[3] > 280)
{
pSprite->pal = 0;
pData[0] = 0;
pData[0] = pData[3] = 0;
goto next_sprite;
}
A_Fall(spriteNum);
......@@ -4798,6 +4798,8 @@ ACTOR_STATIC void G_MoveActors(void)
{
static const char slimeFrames[] = { 5, 5, 6, 6, 7, 7, 6, 5 };
Bassert(pData[3] < ARRAY_SSIZE(slimeFrames));
pSprite->picnum = GREENSLIME + slimeFrames[pData[3]];
if (pData[3] == 5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment