This probably fixes something with projectiles

git-svn-id: https://svn.eduke32.com/eduke32@427 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-12-18 04:18:46 +00:00
parent 15c080e73c
commit cb90dc8c83
3 changed files with 45 additions and 47 deletions

View File

@ -2385,20 +2385,6 @@ static void moveweapons(void)
if (thisprojectile[i].workslike & PROJECTILE_FLAG_KNEE)
KILLIT(i);
if (thisprojectile[i].trail > -1)
{
for (f=0;f<=thisprojectile[i].tnum;f++)
{
j = spawn(i,thisprojectile[i].trail);
if (thisprojectile[i].toffset != 0)
sprite[j].z += (thisprojectile[i].toffset<<8);
if (thisprojectile[i].txrepeat >= 0)
sprite[j].xrepeat=thisprojectile[i].txrepeat;
if (thisprojectile[i].tyrepeat >= 0)
sprite[j].yrepeat=thisprojectile[i].tyrepeat;
}
}
if (thisprojectile[i].workslike & PROJECTILE_FLAG_RPG)
{
// if (thisprojectile[i].workslike & COOLEXPLOSION1)
@ -2413,23 +2399,58 @@ static void moveweapons(void)
if (s->shade >= 40) KILLIT(i);
}
if (thisprojectile[i].drop)
s->zvel -= thisprojectile[i].drop;
if (thisprojectile[i].workslike & PROJECTILE_FLAG_SPIT)
if (s->zvel < 6144)
s->zvel += gc-112;
k = s->xvel;
ll = s->zvel;
if (sector[s->sectnum].lotag == 2)
{
k = s->xvel>>1;
ll = s->zvel>>1;
}
else
{
k = s->xvel;
ll = s->zvel;
}
if (thisprojectile[i].drop) s->zvel=s->zvel-thisprojectile[i].drop;
dax = s->x;
day = s->y;
daz = s->z;
getglobalz(i);
qq = CLIPMASK1;
if (thisprojectile[i].trail > -1)
{
for (f=0;f<=thisprojectile[i].tnum;f++)
{
j = spawn(i,thisprojectile[i].trail);
if (thisprojectile[i].toffset != 0)
sprite[j].z += (thisprojectile[i].toffset<<8);
if (thisprojectile[i].txrepeat >= 0)
sprite[j].xrepeat=thisprojectile[i].txrepeat;
if (thisprojectile[i].tyrepeat >= 0)
sprite[j].yrepeat=thisprojectile[i].tyrepeat;
}
}
for (f=1;f<=thisprojectile[i].velmult;f++)
j = movesprite(i,
(k*(sintable[(s->ang+512)&2047]))>>14,
(k*(sintable[s->ang&2047]))>>14,ll,qq);
if (!(thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0)
if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256)
j = 49152|s->yvel;
if (s->sectnum < 0)
{
KILLIT(i);
}
if (thisprojectile[i].workslike & PROJECTILE_FLAG_TIMED && thisprojectile[i].range > 0)
{
if (!(hittype[i].temp_data[8]))
@ -2499,25 +2520,6 @@ static void moveweapons(void)
}
getglobalz(i);
qq = CLIPMASK1;
for (f=1;f<=thisprojectile[i].velmult;f++)
j = movesprite(i,
(k*(sintable[(s->ang+512)&2047]))>>14,
(k*(sintable[s->ang&2047]))>>14,ll,qq);
if (!(thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0)
if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256)
j = 49152|s->yvel;
if (s->sectnum < 0)
{
KILLIT(i);
}
if ((j&49152) != 49152)
if (!(thisprojectile[i].workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS))
{
@ -2553,9 +2555,6 @@ static void moveweapons(void)
}
}
else */
if (thisprojectile[i].workslike & PROJECTILE_FLAG_SPIT)
if (s->zvel < 6144)
s->zvel += gc-112;
if (thisprojectile[i].workslike & PROJECTILE_FLAG_WATERBUBBLES && sector[s->sectnum].lotag == 2 && rnd(140))
spawn(i,WATERBUBBLE);
@ -2879,8 +2878,8 @@ static void moveweapons(void)
if (s->picnum == RPG && sector[s->sectnum].lotag == 2)
{
k >>= 1;
ll >>= 1;
k = s->xvel>>1;
ll = s->zvel>>1;
}
dax = s->x;

View File

@ -310,7 +310,7 @@ static int menutext_(int x,int y,short s,short p,char *t)
return (x);
}
int menutext(int x,int y,short s,short p,char *t)
inline int menutext(int x,int y,short s,short p,char *t)
{
return(menutext_(x,y,s,p,stripcolorcodes(t)));
}

View File

@ -381,7 +381,6 @@ short shoot(short i,short atwith)
if (projectile[atwith].workslike & PROJECTILE_FLAG_BLOOD)
{
if (projectile[atwith].range == 0)
projectile[atwith].range = 1024;