- final preparations for changing type of cursectnum

This commit is contained in:
Christoph Oelckers 2021-11-21 08:50:04 +01:00
parent 22b2f64016
commit fcbf861ad4
9 changed files with 27 additions and 24 deletions

View file

@ -5,4 +5,5 @@ class FSerializer;
void SECRET_Serialize(FSerializer &arc);
void SECRET_SetMapName(const char *filename, const char *maptitle);
bool SECRET_Trigger(int num);

View file

@ -2928,7 +2928,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
auto psp = ps[p].GetActor();
if (ps[p].insector() && ps[p].cursector()->lotag != 2)
{
if (po[p].os == s->sectnum)
if (po[p].os == s->sector())
{
po[p].ox += m;
po[p].oy += x;
@ -3123,7 +3123,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
ps[p].bobposy += x;
}
if (po[p].os == s->sectnum)
if (po[p].os == s->sector())
{
po[p].ox += l;
po[p].oy += x;

View file

@ -320,6 +320,7 @@ void animatesprites_d(spritetype* tsprite, int& spritesortcnt, int x, int y, int
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
{
t->cstat |= 2;
#if 0 // multiplayer only
if (screenpeek == myconnectindex && numplayers >= 2)
{
t->x = interpolatedvalue(omyx, myx, smoothratio);
@ -328,6 +329,7 @@ void animatesprites_d(spritetype* tsprite, int& spritesortcnt, int x, int y, int
t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild();
t->sectnum = mycursectnum;
}
#endif
}
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->s->extra > 0 && ps[p].curr_weapon > 0)

View file

@ -361,6 +361,7 @@ void animatesprites_r(spritetype* tsprite, int& spritesortcnt, int x, int y, int
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
{
t->cstat |= 2;
#if 0 // multiplayer only
if (screenpeek == myconnectindex && numplayers >= 2)
{
t->x = interpolatedvalue(omyx, myx, smoothratio);
@ -369,6 +370,7 @@ void animatesprites_r(spritetype* tsprite, int& spritesortcnt, int x, int y, int
t->ang = interpolatedangle(omyang, myang, smoothratio).asbuild();
t->sectnum = mycursectnum;
}
#endif
}
if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && cl_showweapon && ps[p].GetActor()->s->extra > 0 && ps[p].curr_weapon > 0)

View file

@ -3070,7 +3070,7 @@ HORIZONLY:
p->pos.x += p->posxv >> 14;
p->pos.y += p->posyv >> 14;
updatesector(p->pos.x, p->pos.y, &p->cursectnum);
changeactorsect(pact, p->cursectnum);
changeactorsect(pact, p->cursector());
}
else
clipmove_ex(&p->pos, &p->cursectnum, p->posxv, p->posyv, 164, (4 << 8), ii, CLIPMASK0, clip);
@ -3117,8 +3117,8 @@ HORIZONLY:
if (!S_CheckActorSoundPlaying(pact, DUKE_ONWATER))
S_PlayActorSound(DUKE_ONWATER, pact);
if (p->cursectnum != s->sectnum)
changeactorsect(pact, p->cursectnum);
if (p->cursector() != s->sector())
changeactorsect(pact, p->cursector());
if (ud.clipping == 0)
j = (pushmove(&p->pos, &p->cursectnum, 164L, (4L << 8), (4L << 8), CLIPMASK0) < 0 && furthestangle(p->GetActor(), 8) < 512);

View file

@ -3364,7 +3364,7 @@ void processinput_r(int snum)
int i, k, doubvel, fz, cz, truefdist;
Collision chz, clz;
bool shrunk;
int psect, psectlotag;
int psectlotag;
auto p = &ps[snum];
auto pact = p->GetActor();
@ -3379,7 +3379,7 @@ void processinput_r(int snum)
auto sb_svel = PlayerInputSideVel(snum);
auto sb_avel = PlayerInputAngVel(snum);
psect = p->cursectnum;
auto psectp = p->cursector();
if (p->OnMotorcycle && s->extra > 0)
{
onMotorcycle(snum, actions);
@ -3388,21 +3388,20 @@ void processinput_r(int snum)
{
onBoat(snum, actions);
}
if (psect == -1)
if (psectp == nullptr)
{
if (s->extra > 0 && ud.clipping == 0)
{
quickkill(p);
S_PlayActorSound(SQUISHED, pact);
}
psect = 0;
psectp = &sector[0];
}
auto psectp = &sector[psect];
psectlotag = psectp->lotag;
if (psectlotag == 867)
{
DukeSectIterator it(psect);
DukeSectIterator it(psectp);
while (auto act2 = it.Next())
{
if (act2->s->picnum == RRTILE380)
@ -3427,17 +3426,17 @@ void processinput_r(int snum)
int tempfz;
if (s->clipdist == 64)
{
getzrange_ex(p->pos.x, p->pos.y, p->pos.z, psect, &cz, chz, &fz, clz, 163L, CLIPMASK0);
tempfz = getflorzofslope(psect, p->pos.x, p->pos.y);
getzrange_ex(p->pos.x, p->pos.y, p->pos.z, psectp, &cz, chz, &fz, clz, 163L, CLIPMASK0);
tempfz = getflorzofslopeptr(psectp, p->pos.x, p->pos.y);
}
else
{
getzrange_ex(p->pos.x, p->pos.y, p->pos.z, psect, &cz, chz, &fz, clz, 4L, CLIPMASK0);
tempfz = getflorzofslope(psect, p->pos.x, p->pos.y);
getzrange_ex(p->pos.x, p->pos.y, p->pos.z, psectp, &cz, chz, &fz, clz, 4L, CLIPMASK0);
tempfz = getflorzofslopeptr(psectp, p->pos.x, p->pos.y);
}
p->truefz = tempfz;
p->truecz = getceilzofslope(psect, p->pos.x, p->pos.y);
p->truecz = getceilzofslopeptr(psectp, p->pos.x, p->pos.y);
truefdist = abs(p->pos.z - tempfz);
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8))
@ -3812,7 +3811,7 @@ HORIZONLY:
p->pos.x += p->posxv >> 14;
p->pos.y += p->posyv >> 14;
updatesector(p->pos.x, p->pos.y, &p->cursectnum);
changeactorsect(pact, p->cursectnum);
changeactorsect(pact, p->cursector());
}
else
clipmove_ex(&p->pos, &p->cursectnum, p->posxv, p->posyv, 164, (4 << 8), i, CLIPMASK0, clip);
@ -3923,7 +3922,6 @@ HORIZONLY:
if (psectlotag < 3)
{
psect = s->sectnum;
psectp = s->sector();
if (ud.clipping == 0 && psectp->lotag == ST_31_TWO_WAY_TRAIN)
{
@ -3941,8 +3939,8 @@ HORIZONLY:
if (!isRRRA() || (!p->OnBoat && !p->OnMotorcycle && p->cursector()->hitag != 321))
S_PlayActorSound(DUKE_ONWATER, pact);
if (p->cursectnum != s->sectnum)
changeactorsect(pact, p->cursectnum);
if (p->cursector() != s->sector())
changeactorsect(pact, p->cursector());
int j;
if (ud.clipping == 0)

View file

@ -82,7 +82,7 @@ void fakedomovethingscorrect(void)
myy = p->pos.y; omyy = p->oposy; myyvel = p->posyv;
myz = p->pos.z; omyz = p->oposz; myzvel = p->poszv;
myang = p->ang; omyang = p->oang;
mycursectnum = p->cursectnum;
mycursectnum = p->cursector;
myhoriz = p->horiz; omyhoriz = p->ohoriz;
myhorizoff = p->horizoff; omyhorizoff = p->ohorizoff;
myjumpingcounter = p->jumping_counter;

View file

@ -64,7 +64,7 @@ void pickrandomspot(int snum)
p->bobposy = p->oposy = p->pos.y = po[i].oy;
p->oposz = p->pos.z = po[i].oz;
p->angle.oang = p->angle.ang = buildang(po[i].oa);
p->cursectnum = po[i].os;
p->setCursector(po[i].os);
}
@ -588,7 +588,7 @@ void resetpspritevars(int g)
po[numplayersprites].oy = s->y;
po[numplayersprites].oz = s->z;
po[numplayersprites].oa = s->ang;
po[numplayersprites].os = s->sectnum;
po[numplayersprites].os = s->sector();
numplayersprites++;
if (j >= 0)

View file

@ -165,7 +165,7 @@ struct player_orig
{
int ox, oy, oz;
short oa;
int os;
sectortype* os;
};
struct CraneDef