Skip to content

Commit

Permalink
- copied ST160/161 handling to movetransports_d.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Mar 27, 2023
1 parent 5c8bfee commit cf0598e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions source/games/duke/src/actors_d.cpp
Expand Up @@ -357,6 +357,25 @@ void movetransports_d(void)

int k = 0;

if (ud.mapflags & MFLAG_ALLSECTORTYPES)
{
if (onfloorz && sectlotag == ST_160_FLOOR_TELEPORT && ps[p].GetActor()->getOffsetZ() > sectp->floorz - 48)
{
k = 2;
ps[p].GetActor()->spr.pos.Z = Owner->sector()->ceilingz + 7 + gs.playerheight;
ps[p].GetActor()->backupz();
}

if (onfloorz && sectlotag == ST_161_CEILING_TELEPORT && ps[p].GetActor()->getOffsetZ() < sectp->ceilingz + 6)
{
k = 2;
if (ps[p].GetActor()->spr.extra <= 0) break;
ps[p].GetActor()->spr.pos.Z = Owner->sector()->floorz - 49 + gs.playerheight;
ps[p].GetActor()->backupz();
}
}


if (onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].on_ground && ps[p].GetActor()->getOffsetZ() > (sectp->floorz - 16) && (PlayerInput(p, SB_CROUCH) || ps[p].vel.Z > 8))
// if( onfloorz && sectlotag == 1 && ps[p].pos.z > (sectp->floorz-(6<<8)) )
{
Expand Down Expand Up @@ -415,6 +434,17 @@ void movetransports_d(void)
if (q) q->spr.pos.Z += krandf(64);
}
}
else if (k == 2)
{
ps[p].GetActor()->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
ps[p].GetActor()->backupvec2();

if (Owner->GetOwner() != Owner)
ps[p].transporter_hold = -2;
ps[p].setCursector(Owner->sector());

ChangeActorSect(act2, Owner->sector());
}
}
break;

Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/actors_r.cpp
Expand Up @@ -395,7 +395,7 @@ void movetransports_r(void)
if ((krand() & 255) < 32)
spawn(ps[p].GetActor(), DukeWaterSplashClass);
}
else if (isRRRA() && k == 2)
else if (k == 2)
{
ps[p].GetActor()->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
ps[p].GetActor()->backupvec2();
Expand Down

0 comments on commit cf0598e

Please sign in to comment.