Retire actor[].shootzvel, as it was only ever used in local scope.

That is, its value was only referenced during the duration of a function call
that had previously set it. It was also never accessible from CON.

git-svn-id: https://svn.eduke32.com/eduke32@3921 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-06-30 20:38:50 +00:00
parent e164bd7f1e
commit 73b5d064da
4 changed files with 19 additions and 22 deletions

View file

@ -142,9 +142,8 @@ typedef struct {
int16_t picnum,ang,extra,owner; //8b
int16_t movflag,tempang,timetosleep; //6b
// NOTE: shootzvel is not exposed but only used temporarily in player.c
// shooting routines.
int16_t actorstayput, dispicnum, shootzvel, cgg; // 8b
// NOTE: shootzvel is not used any more.
int16_t actorstayput, dispicnum, shootzvel_, cgg; // 8b
int16_t lightId, lightcount, lightmaxrange; //6b
#ifdef POLYMER
@ -192,7 +191,7 @@ typedef struct {
int16_t picnum,ang,extra,owner; //8b
int16_t movflag,tempang,timetosleep; // 6b
int16_t actorstayput, dispicnum, shootzvel, cgg; // 8b
int16_t actorstayput, dispicnum, shootzvel_, cgg; // 8b
spritetype sprite;
int16_t netIndex;

View file

@ -2540,8 +2540,8 @@ nullquote:
insptr++;
{
int32_t j;
// NOTE: (int16_t) cast because actor[].shootzvel is int16_t
// and we want exclude that SHOOT_HARDCODED_ZVEL is passed.
// NOTE: (int16_t) cast because we want to exclude that
// SHOOT_HARDCODED_ZVEL is passed.
const int32_t zvel = (tw == CON_ESHOOT) ?
SHOOT_HARDCODED_ZVEL : (int16_t)Gv_GetVarX(*insptr++);

View file

@ -1244,7 +1244,6 @@ void Net_CopyToNet(int32_t i, netactor_t *netactor)
netactor->lasttransport = actor[i].lasttransport;
netactor->actorstayput = actor[i].actorstayput;
//netactor->dispicnum = actor[i].dispicnum;
netactor->shootzvel = actor[i].shootzvel;
netactor->cgg = actor[i].cgg;
netactor->owner = actor[i].owner;
@ -1286,7 +1285,6 @@ void Net_CopyFromNet(int32_t i, netactor_t *netactor)
actor[i].lasttransport = netactor->lasttransport;
actor[i].actorstayput = netactor->actorstayput;
actor[i].dispicnum = netactor->dispicnum;
actor[i].shootzvel = netactor->shootzvel;
actor[i].cgg = netactor->cgg;
actor[i].owner = netactor->owner;
@ -1316,7 +1314,6 @@ int32_t Net_ActorsAreDifferent(netactor_t *actor1, netactor_t *actor2)
actor1->lasttransport != actor2->lasttransport ||
actor1->actorstayput != actor2->actorstayput ||
//actor1->dispicnum != actor2->dispicnum ||
actor1->shootzvel != actor2->shootzvel ||
//actor1->cgg != actor2->cgg ||
actor1->sprite.owner != actor2->sprite.owner ||

View file

@ -435,11 +435,12 @@ static void Proj_MaybeAddSpread(int32_t not_accurate_p, int32_t *zvel, int16_t *
}
static int32_t use_actor_shootzvel = 0;
static int32_t g_overrideShootZvel = 0; // a boolean
static int32_t g_shootZvel; // the actual zvel if the above is !=0
static int32_t A_GetShootZvel(int32_t i, int32_t defaultzvel)
static int32_t A_GetShootZvel(int32_t defaultzvel)
{
return use_actor_shootzvel ? actor[i].shootzvel : defaultzvel;
return g_overrideShootZvel ? g_shootZvel : defaultzvel;
}
// Prepare hitscan weapon fired from player p.
@ -479,7 +480,7 @@ static void P_PreFireHitscan(int32_t i, int32_t p, int32_t atwith,
{
hitdata_t hit;
*zvel = A_GetShootZvel(i, (100-ps->horiz-ps->horizoff)<<5);
*zvel = A_GetShootZvel((100-ps->horiz-ps->horizoff)<<5);
hitscan(srcvect, sprite[i].sectnum, sintable[(*sa+512)&2047], sintable[*sa&2047],
*zvel<<6,&hit,CLIPMASK1);
@ -543,7 +544,7 @@ static int32_t Proj_DoHitscan(int32_t i, int32_t cstatmask,
s->cstat &= ~cstatmask;
zvel = A_GetShootZvel(i, zvel);
zvel = A_GetShootZvel(zvel);
hitscan(srcvect, s->sectnum,
sintable[(sa+512)&2047],
@ -832,12 +833,12 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
if (override_zvel != SHOOT_HARDCODED_ZVEL)
{
use_actor_shootzvel = 1;
actor[i].shootzvel = override_zvel;
g_overrideShootZvel = 1;
g_shootZvel = override_zvel;
}
else
{
use_actor_shootzvel = 0;
g_overrideShootZvel = 0;
}
if (s->picnum == APLAYER)
@ -1103,7 +1104,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
if (numplayers > 1 && g_netClient) return -1;
zvel = A_GetShootZvel(i, zvel);
zvel = A_GetShootZvel(zvel);
j = A_InsertSprite(sect,
srcvect.x+(sintable[(348+sa+512)&2047]/proj->offset),
srcvect.y+(sintable[(sa+348)&2047]/proj->offset),
@ -1287,7 +1288,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
zvel = ((g_player[j].ps->opos.z - srcvect.z + (3<<8))*vel) / hit.pos.x;
}
zvel = A_GetShootZvel(i, zvel);
zvel = A_GetShootZvel(zvel);
if (atwith == SPIT)
{
@ -1380,7 +1381,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
if (numplayers > 1 && g_netClient) return -1;
zvel = A_GetShootZvel(i, zvel);
zvel = A_GetShootZvel(zvel);
j = A_InsertSprite(sect,
srcvect.x+(sintable[(348+sa+512)&2047]/448),
srcvect.y+(sintable[(sa+348)&2047]/448),
@ -1544,7 +1545,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
zvel = -2048;
vel = x>>4;
zvel = A_GetShootZvel(i, zvel);
zvel = A_GetShootZvel(zvel);
A_InsertSprite(sect,
srcvect.x+(sintable[(512+sa+512)&2047]>>8),
srcvect.y+(sintable[(sa+512)&2047]>>8),
@ -1638,7 +1639,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
}
else zvel = 0;
zvel = A_GetShootZvel(i, zvel);
zvel = A_GetShootZvel(zvel);
j = A_InsertSprite(sect,
srcvect.x+(sintable[(512+sa+512)&2047]>>12),
srcvect.y+(sintable[(sa+512)&2047]>>12),