Fix enemy respawning. Verified in disassembly

This commit is contained in:
nukeykt 2019-09-30 14:55:24 +09:00 committed by Christoph Oelckers
parent 0d2567a808
commit c00ff59579

View file

@ -90,7 +90,7 @@ char SetSpriteState(int nSprite, XSPRITE* pXSprite, int nState)
pXSprite->busy = nState << 16; pXSprite->busy = nState << 16;
pXSprite->state = nState; pXSprite->state = nState;
evKill(nSprite, 3); evKill(nSprite, 3);
if ((sprite[nSprite].hitag & 16) != 0 && sprite[nSprite].type >= kDudeBase && sprite[nSprite].type < kDudeMax) if ((sprite[nSprite].hitag & 16) != 0 && sprite[nSprite].zvel >= kDudeBase && sprite[nSprite].zvel < kDudeMax)
{ {
pXSprite->respawnPending = 3; pXSprite->respawnPending = 3;
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, CALLBACK_ID_9); evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, CALLBACK_ID_9);
@ -115,7 +115,7 @@ char modernTypeSetSpriteState(int nSprite, XSPRITE *pXSprite, int nState)
pXSprite->busy = nState<<16; pXSprite->busy = nState<<16;
pXSprite->state = nState; pXSprite->state = nState;
evKill(nSprite, 3); evKill(nSprite, 3);
if ((sprite[nSprite].hitag & 16) != 0 && sprite[nSprite].type >= kDudeBase && sprite[nSprite].type < kDudeMax) if ((sprite[nSprite].hitag & 16) != 0 && sprite[nSprite].zvel >= kDudeBase && sprite[nSprite].zvel < kDudeMax)
{ {
pXSprite->respawnPending = 3; pXSprite->respawnPending = 3;
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, CALLBACK_ID_9); evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, CALLBACK_ID_9);