Fix issue where sometimes hitscan projectile trails weren't spawning

git-svn-id: https://svn.eduke32.com/eduke32@5726 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-05-13 22:15:31 +00:00
parent 0de66c3411
commit a3b3a992c0

View file

@ -140,10 +140,9 @@ static inline projectile_t * Proj_GetProjectile(int tile)
return ((unsigned)tile < MAXTILES && g_tile[tile].proj) ? g_tile[tile].proj : &DefaultProjectile;
}
static void A_HitscanProjTrail(const vec3_t *sv, const vec3_t *dv, int32_t ang, int32_t atwith)
static void A_HitscanProjTrail(const vec3_t *sv, const vec3_t *dv, int32_t ang, int32_t atwith, int16_t sect)
{
int32_t n, j, i;
int16_t sect = -1;
vec3_t srcvect;
vec3_t destvect;
@ -170,7 +169,7 @@ static void A_HitscanProjTrail(const vec3_t *sv, const vec3_t *dv, int32_t ang,
srcvect.x += destvect.x;
srcvect.y += destvect.y;
srcvect.z += destvect.z;
updatesector(srcvect.x,srcvect.y,&sect);
updatesectorz(srcvect.x,srcvect.y,srcvect.z,&sect);
if (sect < 0)
break;
getzsofslope(sect,srcvect.x,srcvect.y,&n,&j);
@ -911,7 +910,7 @@ static int32_t A_ShootCustom(const int32_t i, const int32_t atwith, int16_t sa,
return -1;
if (proj->trail >= 0)
A_HitscanProjTrail(srcvect, &hit.pos, sa, atwith);
A_HitscanProjTrail(srcvect, &hit.pos, sa, atwith, sect);
if (proj->workslike & PROJECTILE_WATERBUBBLES)
{