Prevent an (unlikely) integer overflow in neartag with huge switch sprites.

git-svn-id: https://svn.eduke32.com/eduke32@2641 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-05-05 22:24:17 +00:00
parent 7cd2c19801
commit 8ea5b89be6

View file

@ -11592,8 +11592,8 @@ void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange,
offx = scale(vx,topu,bot);
offy = scale(vy,topu,bot);
dist = offx*offx + offy*offy;
i = (tilesizx[spr->picnum]*spr->xrepeat); i *= i;
if (dist <= (i>>7))
i = (tilesizx[spr->picnum]*spr->xrepeat);
if (dist <= mulscale7(i,i))
{
intx = xs + scale(vx,topt,bot);
inty = ys + scale(vy,topt,bot);