- renamed variables.

This commit is contained in:
Christoph Oelckers 2020-11-01 10:49:50 +01:00
parent f0b1ab504d
commit 6a97b3d58e
2 changed files with 45 additions and 45 deletions

View file

@ -5279,60 +5279,60 @@ void alterang(int ang, DDukeActor* actor, int playernum)
//
//---------------------------------------------------------------------------
void fall_common(DDukeActor *actor, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOTSPARK1, int squished, int thud, int(*fallspecial)(DDukeActor*, int))
void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLOODPOOL, int SHOTSPARK1, int squished, int thud, int(*fallspecial)(DDukeActor*, int))
{
auto g_sp = &actor->s;
g_sp->xoffset = 0;
g_sp->yoffset = 0;
auto s = &actor->s;
s->xoffset = 0;
s->yoffset = 0;
// if(!gotz)
{
int c;
int sphit = fallspecial? fallspecial(actor, g_p) : 0;
if (fi.floorspace(g_sp->sectnum))
int sphit = fallspecial? fallspecial(actor, playernum) : 0;
if (fi.floorspace(s->sectnum))
c = 0;
else
{
if (fi.ceilingspace(g_sp->sectnum) || sector[g_sp->sectnum].lotag == 2)
if (fi.ceilingspace(s->sectnum) || sector[s->sectnum].lotag == 2)
c = gc / 6;
else c = gc;
}
if (actor->cgg <= 0 || (sector[g_sp->sectnum].floorstat & 2))
if (actor->cgg <= 0 || (sector[s->sectnum].floorstat & 2))
{
getglobalz(actor);
actor->cgg = 6;
}
else actor->cgg--;
if (g_sp->z < (actor->floorz - FOURSLEIGHT))
if (s->z < (actor->floorz - FOURSLEIGHT))
{
g_sp->zvel += c;
g_sp->z += g_sp->zvel;
s->zvel += c;
s->z += s->zvel;
if (g_sp->zvel > 6144) g_sp->zvel = 6144;
if (s->zvel > 6144) s->zvel = 6144;
}
else
{
g_sp->z = actor->floorz - FOURSLEIGHT;
s->z = actor->floorz - FOURSLEIGHT;
if (badguy(actor) || (g_sp->picnum == TILE_APLAYER && actor->GetOwner()))
if (badguy(actor) || (s->picnum == TILE_APLAYER && actor->GetOwner()))
{
if (g_sp->zvel > 3084 && g_sp->extra <= 1)
if (s->zvel > 3084 && s->extra <= 1)
{
if (g_sp->pal != 1 && g_sp->picnum != DRONE)
if (s->pal != 1 && s->picnum != DRONE)
{
if (g_sp->picnum == TILE_APLAYER && g_sp->extra > 0)
if (s->picnum == TILE_APLAYER && s->extra > 0)
goto SKIPJIBS;
if (sphit)
{
fi.guts(&actor->s, JIBS6, 5, g_p);
fi.guts(&actor->s, JIBS6, 5, playernum);
S_PlayActorSound(squished, actor);
}
else
{
fi.guts(&actor->s, JIBS6, 15, g_p);
fi.guts(&actor->s, JIBS6, 15, playernum);
S_PlayActorSound(squished, actor);
spawn(actor, BLOODPOOL);
}
@ -5342,24 +5342,24 @@ void fall_common(DDukeActor *actor, int g_p, int JIBS6, int DRONE, int BLOODPOOL
actor->picnum = SHOTSPARK1;
actor->extra = 1;
g_sp->zvel = 0;
s->zvel = 0;
}
else if (g_sp->zvel > 2048 && sector[g_sp->sectnum].lotag != 1)
else if (s->zvel > 2048 && sector[s->sectnum].lotag != 1)
{
short j = g_sp->sectnum;
int x = g_sp->x, y = g_sp->y, z = g_sp->z;
short j = s->sectnum;
int x = s->x, y = s->y, z = s->z;
pushmove(&x, &y, &z, &j, 128, (4 << 8), (4 << 8), CLIPMASK0);
setspritepos(actor->GetIndex(), x, y, z); // wrap this for safety. The renderer may need processing of the new position.
if (j != g_sp->sectnum && j >= 0 && j < MAXSECTORS)
if (j != s->sectnum && j >= 0 && j < MAXSECTORS)
changespritesect(actor, j);
S_PlayActorSound(thud, actor);
}
}
if (sector[g_sp->sectnum].lotag == 1)
g_sp->z += actorinfo[g_sp->picnum].falladjustz;
else g_sp->zvel = 0;
if (sector[s->sectnum].lotag == 1)
s->z += actorinfo[s->picnum].falladjustz;
else s->zvel = 0;
}
}
}

View file

@ -4078,15 +4078,15 @@ void fakebubbaspawn(int g_i, int g_p)
//
//---------------------------------------------------------------------------
static int fallspecial(DDukeActor *actor, int g_p)
static int fallspecial(DDukeActor *actor, int playernum)
{
auto g_sp = &actor->s;
auto s = &actor->s;
int sphit = 0;
if (isRRRA())
{
if (sector[g_sp->sectnum].lotag == 801)
if (sector[s->sectnum].lotag == 801)
{
if (g_sp->picnum == ROCK)
if (s->picnum == ROCK)
{
spawn(actor, ROCK2);
spawn(actor, ROCK2);
@ -4094,39 +4094,39 @@ static int fallspecial(DDukeActor *actor, int g_p)
}
return 0;
}
else if (sector[g_sp->sectnum].lotag == 802)
else if (sector[s->sectnum].lotag == 802)
{
if (g_sp->picnum != APLAYER && badguy(actor) && g_sp->z == actor->floorz - FOURSLEIGHT)
if (s->picnum != APLAYER && badguy(actor) && s->z == actor->floorz - FOURSLEIGHT)
{
fi.guts(&actor->s, JIBS6, 5, g_p);
fi.guts(&actor->s, JIBS6, 5, playernum);
S_PlayActorSound(SQUISHED, actor);
addspritetodelete();
}
return 0;
}
else if (sector[g_sp->sectnum].lotag == 803)
else if (sector[s->sectnum].lotag == 803)
{
if (g_sp->picnum == ROCK2)
if (s->picnum == ROCK2)
addspritetodelete();
return 0;
}
}
if (sector[g_sp->sectnum].lotag == 800)
if (sector[s->sectnum].lotag == 800)
{
if (g_sp->picnum == 40)
if (s->picnum == 40)
{
addspritetodelete();
return 0;
}
if (g_sp->picnum != APLAYER && (badguy(actor) || g_sp->picnum == HEN || g_sp->picnum == COW || g_sp->picnum == PIG || g_sp->picnum == DOGRUN || g_sp->picnum == RABBIT) && (!isRRRA() || actor->spriteextra < 128))
if (s->picnum != APLAYER && (badguy(actor) || s->picnum == HEN || s->picnum == COW || s->picnum == PIG || s->picnum == DOGRUN || s->picnum == RABBIT) && (!isRRRA() || actor->spriteextra < 128))
{
g_sp->z = actor->floorz - FOURSLEIGHT;
g_sp->zvel = 8000;
g_sp->extra = 0;
s->z = actor->floorz - FOURSLEIGHT;
s->zvel = 8000;
s->extra = 0;
actor->spriteextra++;
sphit = 1;
}
else if (g_sp->picnum != APLAYER)
else if (s->picnum != APLAYER)
{
if (!actor->spriteextra)
addspritetodelete();
@ -4135,9 +4135,9 @@ static int fallspecial(DDukeActor *actor, int g_p)
actor->picnum = SHOTSPARK1;
actor->extra = 1;
}
else if (isRRRA() && (sector[g_sp->sectnum].floorpicnum == RRTILE7820 || sector[g_sp->sectnum].floorpicnum == RRTILE7768))
else if (isRRRA() && (sector[s->sectnum].floorpicnum == RRTILE7820 || sector[s->sectnum].floorpicnum == RRTILE7768))
{
if (g_sp->picnum != MINION && g_sp->pal != 19)
if (s->picnum != MINION && s->pal != 19)
{
if ((krand() & 3) == 1)
{