- remapped all copy assignments to DDukeActor::ceilingz/floorz.

This commit does not work! It was split for clarity.
This commit is contained in:
Christoph Oelckers 2022-02-04 00:44:13 +01:00
parent e3d5397d7e
commit 89c0e4234c
11 changed files with 38 additions and 49 deletions

View file

@ -889,7 +889,7 @@ void moveflammable(DDukeActor* actor, int pool)
if (actorflag(actor, SFLAG_FALLINGFLAMMABLE))
{
makeitfall(actor);
actor->__int_ceilingz = actor->sector()->int_ceilingz();
actor->ceilingz = actor->sector()->ceilingz;
}
}
@ -3849,8 +3849,8 @@ void handle_se17(DDukeActor* actor)
act1->add_int_z(q);
}
act1->__int_floorz = sc->int_floorz();
act1->__int_ceilingz = sc->int_ceilingz();
act1->floorz = sc->floorz;
act1->ceilingz = sc->ceilingz;
}
if (actor->temp_data[0]) //If in motion
@ -3893,8 +3893,8 @@ void handle_se17(DDukeActor* actor)
ps[p].pos.Y += act2->int_pos().Y - actor->int_pos().Y;
ps[p].pos.Z = act2->sector()->int_floorz() - (sc->int_floorz() - ps[p].pos.Z);
act3->__int_floorz = act2->sector()->int_floorz();
act3->__int_ceilingz = act2->sector()->int_ceilingz();
act3->floorz = act2->sector()->floorz;
act3->ceilingz = act2->sector()->ceilingz;
ps[p].bobpos.X = ps[p].opos.X = ps[p].pos.X;
ps[p].bobpos.Y = ps[p].opos.Y = ps[p].pos.Y;
@ -3917,8 +3917,8 @@ void handle_se17(DDukeActor* actor)
ChangeActorSect(act3, act2->sector());
SetActor(act3, act3->int_pos());
act3->__int_floorz = act2->sector()->int_floorz();
act3->__int_ceilingz = act2->sector()->int_ceilingz();
act3->floorz = act2->sector()->floorz;
act3->ceilingz = act2->sector()->ceilingz;
}
}
@ -3962,7 +3962,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
{
a2->add_int_z(sc->extra);
a2->__int_floorz = sc->int_floorz();
a2->floorz = sc->floorz;
}
}
}
@ -3999,7 +3999,7 @@ void handle_se18(DDukeActor *actor, bool morecheck)
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && a2->spr.statnum != STAT_PROJECTILE)
{
a2->add_int_z(-sc->extra);
a2->__int_floorz = sc->int_floorz();
a2->floorz = sc->floorz;
}
}
}
@ -4695,7 +4695,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(l);
a2->__int_floorz = sec->int_floorz();
a2->floorz = sec->floorz;
}
}
}
@ -4724,7 +4724,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(l);
a2->__int_floorz = sec->int_floorz();
a2->floorz = sec->floorz;
}
}
}
@ -4755,7 +4755,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(l);
a2->__int_floorz = sec->int_floorz();
a2->floorz = sec->floorz;
}
}
}
@ -4783,7 +4783,7 @@ void handle_se31(DDukeActor* actor, bool choosedir)
if (a2->spr.zvel == 0 && a2->spr.statnum != STAT_EFFECTOR && (!choosedir || a2->spr.statnum != STAT_PROJECTILE))
{
a2->add_int_z(-l);
a2->__int_floorz = sec->int_floorz();
a2->floorz = sec->floorz;
}
}
}
@ -4833,15 +4833,15 @@ void getglobalz(DDukeActor* actor)
}
else if(actor->spr.statnum == STAT_PROJECTILE && lz.actor()->isPlayer() && actor->GetOwner() == actor)
{
actor->__int_ceilingz = actor->sector()->int_ceilingz();
actor->__int_floorz = actor->sector()->int_floorz();
actor->ceilingz = actor->sector()->ceilingz;
actor->floorz = actor->sector()->floorz;
}
}
}
else
{
actor->__int_ceilingz = actor->sector()->int_ceilingz();
actor->__int_floorz = actor->sector()->int_floorz();
actor->ceilingz = actor->sector()->ceilingz;
actor->floorz = actor->sector()->floorz;
}
}
@ -4876,8 +4876,8 @@ void makeitfall(DDukeActor* actor)
}
else
{
actor->__int_ceilingz = actor->sector()->int_ceilingz();
actor->__int_floorz = actor->sector()->int_floorz();
actor->ceilingz = actor->sector()->ceilingz;
actor->floorz = actor->sector()->floorz;
}
if( actor->int_pos().Z < actor->actor_int_floorz()-(FOURSLEIGHT) )

View file

@ -3077,8 +3077,7 @@ void moveexplosions_d(void) // STATNUM 5
case MONEY + 1:
case MAIL + 1:
case PAPER + 1:
act->__int_floorz = getflorzofslopeptr(act->sector(), act->int_pos().X, act->int_pos().Y);
act->set_int_z(act->__int_floorz);
act->spr.zvel = act->floorz = getflorzofslopeptrf(act->sector(), act->spr.pos.X, act->spr.pos.Y);
break;
case MONEY:
case MAIL:

View file

@ -3013,8 +3013,7 @@ void moveexplosions_r(void) // STATNUM 5
deletesprite(act);
continue;
case FEATHER + 1: // feather
act->__int_floorz = getflorzofslopeptr(act->sector(), act->int_pos().X, act->int_pos().Y);
act->set_int_z(act->__int_floorz);
act->spr.pos.Z = act->floorz = getflorzofslopeptrf(act->sector(), act->spr.pos.X, act->spr.pos.Y);
if (act->sector()->lotag == 800)
{
deletesprite(act);

View file

@ -1306,11 +1306,11 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
else SetGameVarID(lVar2, act->timetosleep, sActor, sPlayer);
break;
case ACTOR_HTFLOORZ:
if (bSet) act->__int_floorz = lValue;
if (bSet) act->floorz = lValue * zmaptoworld;
else SetGameVarID(lVar2, act->actor_int_floorz(), sActor, sPlayer);
break;
case ACTOR_HTCEILINGZ:
if (bSet) act->__int_ceilingz = lValue;
if (bSet) act->ceilingz = lValue * zmaptoworld;
else SetGameVarID(lVar2, act->actor_int_ceilingz(), sActor, sPlayer);
break;
case ACTOR_HTLASTVX:

View file

@ -2747,8 +2747,8 @@ void processinput_d(int snum)
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8))
psectlotag = 0;
pact->__int_floorz = fz;
pact->__int_ceilingz = cz;
pact->floorz = fz * zinttoworld;
pact->ceilingz = cz * zinttoworld;
if (SyncInput())
{

View file

@ -3417,8 +3417,8 @@ void processinput_r(int snum)
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8))
psectlotag = 0;
pact->__int_floorz = fz;
pact->__int_ceilingz = cz;
pact->floorz = fz * zinttoworld;
pact->ceilingz = cz * zinttoworld;
if (SyncInput())
{

View file

@ -355,8 +355,8 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
}
}
cz = p->GetActor()->__int_ceilingz;
fz = p->GetActor()->__int_floorz;
cz = p->GetActor()->actor_int_ceilingz();
fz = p->GetActor()->actor_int_floorz();
if (earthquaketime > 0 && p->on_ground == 1)
{

View file

@ -307,8 +307,8 @@ void DDukeActor::Serialize(FSerializer& arc)
("dispicnum", dispicnum)
("basepicnum", basepicnum)
("timetosleep", timetosleep)
("floorz", __int_floorz)
("ceilingz", __int_ceilingz)
("floorz", floorz)
("ceilingz", ceilingz)
("lastvx", ovel.X)
("lastvy", ovel.Y)
("saved_ammo", saved_ammo)

View file

@ -402,7 +402,7 @@ void doanimations(void)
{
act->backupz();
act->add_int_z(v);
act->__int_floorz = dasectp->int_floorz() + v;
act->floorz = dasectp->floorz + v * zinttoworld;
}
}
}

View file

@ -96,8 +96,8 @@ DDukeActor* EGS(sectortype* whatsectp, int s_x, int s_y, int s_z, int s_pn, int8
if (s_ow)
{
act->attackertype = s_ow->spr.picnum;
act->__int_floorz = s_ow->__int_floorz;
act->__int_ceilingz = s_ow->__int_ceilingz;
act->floorz = s_ow->floorz;
act->ceilingz = s_ow->ceilingz;
}
else
{
@ -150,8 +150,8 @@ bool initspriteforspawn(DDukeActor* act)
act->movflag = 0;
act->tempang = 0;
act->dispicnum = 0;
act->__int_floorz = act->sector()->int_floorz();
act->__int_ceilingz = act->sector()->int_ceilingz();
act->floorz = act->sector()->floorz;
act->ceilingz = act->sector()->ceilingz;
act->ovel.X = 0;
act->ovel.Y = 0;

View file

@ -123,23 +123,14 @@ public:
int actor_int_ceilingz() const
{
return __int_ceilingz;
return ceilingz * zworldtoint;
}
int actor_int_floorz() const
{
return __int_floorz;
return floorz * zworldtoint;
}
double float_ceilingz() const
{
return __int_ceilingz * inttoworld;
}
double float_floorz() const
{
return __int_floorz * inttoworld;
}
void ChangeType(PClass* newtype)
{