extra can be -1 then pointer will point to random (#145)

This commit is contained in:
CommonLoon102 2019-08-26 03:12:57 +00:00 committed by Christoph Oelckers
parent 44bcd26fab
commit 9715b2281a
2 changed files with 2 additions and 2 deletions

View file

@ -6059,7 +6059,7 @@ void actProcessSprites(void)
GibSprite(pSprite, GIBTYPE_17, NULL, NULL); GibSprite(pSprite, GIBTYPE_17, NULL, NULL);
actPostSprite(pSprite->index, 1024); actPostSprite(pSprite->index, 1024);
} }
if (pTarget->extra && xsprite[pTarget->extra].health > 0) if (pTarget->extra > 0 && xsprite[pTarget->extra].health > 0)
{ {
int x = pTarget->x+mulscale30r(Cos(pXSprite->goalAng+pTarget->ang), pTarget->clipdist*2); int x = pTarget->x+mulscale30r(Cos(pXSprite->goalAng+pTarget->ang), pTarget->clipdist*2);
int y = pTarget->y+mulscale30r(Sin(pXSprite->goalAng+pTarget->ang), pTarget->clipdist*2); int y = pTarget->y+mulscale30r(Sin(pXSprite->goalAng+pTarget->ang), pTarget->clipdist*2);

View file

@ -2174,7 +2174,7 @@ void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t
sectortype *pSector = &sector[pTSprite->sectnum]; sectortype *pSector = &sector[pTSprite->sectnum];
XSECTOR *pXSector; XSECTOR *pXSector;
int nShade = pTSprite->shade; int nShade = pTSprite->shade;
if (pSector->extra) if (pSector->extra > 0)
{ {
pXSector = &xsector[pSector->extra]; pXSector = &xsector[pSector->extra];
} }