Apply the same autoaim Z position offsetting logic used on GREENSLIME and ROTATEGUN to any sprite with CSTAT_SPRITE_YCENTER set

git-svn-id: https://svn.eduke32.com/eduke32@6971 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-09-01 19:36:01 +00:00
parent 41ed560c45
commit e8b042899b

View file

@ -372,9 +372,11 @@ static int GetAutoAimAng(int spriteNum, int playerNum, int projecTile, int zAdju
#ifndef EDUKE32_STANDALONE #ifndef EDUKE32_STANDALONE
if (aimFlags && if (aimFlags &&
((pSprite->picnum >= GREENSLIME && pSprite->picnum <= GREENSLIME + 7) || pSprite->picnum == ROTATEGUN)) ((pSprite->picnum >= GREENSLIME && pSprite->picnum <= GREENSLIME + 7) || pSprite->picnum == ROTATEGUN || pSprite->cstat & CSTAT_SPRITE_YCENTER))
zCenter -= ZOFFSET3; #else
if (aimFlags && pSprite->cstat & CSTAT_SPRITE_YCENTER)
#endif #endif
zCenter -= ZOFFSET3;
int spriteDist = safeldist(g_player[playerNum].ps->i, &sprite[returnSprite]); int spriteDist = safeldist(g_player[playerNum].ps->i, &sprite[returnSprite]);
*pZvel = tabledivide32_noinline((pSprite->z - startPos->z - zCenter) * projVel, spriteDist); *pZvel = tabledivide32_noinline((pSprite->z - startPos->z - zCenter) * projVel, spriteDist);