mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- floatified TRACK_ACTOR_CLIMB_LADDER case in ActorTrackDecide
This commit is contained in:
parent
ad648676b1
commit
5bb9a16d34
4 changed files with 22 additions and 11 deletions
|
@ -198,6 +198,16 @@ inline int MOVEy(int vel, int ang)
|
|||
return (MulScale(vel, bsin(ang), 14));
|
||||
}
|
||||
|
||||
inline double MOVEx(int vel, DAngle ang)
|
||||
{
|
||||
return vel * ang.Cos() * inttoworld;
|
||||
}
|
||||
|
||||
inline double MOVEy(int vel, DAngle ang)
|
||||
{
|
||||
return vel * ang.Sin() * inttoworld;
|
||||
}
|
||||
|
||||
inline int SQ(int val)
|
||||
{
|
||||
return val * val;
|
||||
|
|
|
@ -2592,9 +2592,10 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
|||
if (vel > 13000)
|
||||
{
|
||||
vec3_t hit_pos = { (x[0] + x[1]) >> 1, (y[0] + y[1]) >> 1, pp->cursector->int_floorz() - Z(10) };
|
||||
DVector3 hitpos(hit_pos.X * inttoworld, hit_pos.Y * inttoworld, pp->cursector->floorz - 10);
|
||||
|
||||
hitscan(hit_pos, pp->cursector,
|
||||
{ MOVEx(256, pp->angle.ang.Buildang()), MOVEy(256, pp->angle.ang.Buildang()), 0 },
|
||||
hitscan(hitpos, pp->cursector,
|
||||
DVector3(MOVEx(256, pp->angle.ang), MOVEy(256, pp->angle.ang), 0),
|
||||
hit, CLIPMASK_PLAYER);
|
||||
|
||||
if (FindDistance2D(hit.int_hitpos().vec2 - hit_pos.vec2) < 800)
|
||||
|
|
|
@ -2491,7 +2491,7 @@ void SpriteSetup(void)
|
|||
actorNew->set_int_ang(NORM_ANGLE(actor->int_ang() + 1024));
|
||||
actorNew->spr.picnum = actor->spr.picnum;
|
||||
|
||||
actorNew->add_int_pos({ MOVEx(256 + 128, actor->int_ang()), MOVEy(256 + 128, actor->int_ang()), 0 });
|
||||
actorNew->spr.pos += DVector2(MOVEx(256 + 128, actor->spr.angle), MOVEy(256 + 128, actor->spr.angle));
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ void QuickLadderSetup(short stat, short lotag, short type)
|
|||
// add start point
|
||||
start_sprite->spr.lotag = TRACK_START;
|
||||
start_sprite->spr.hitag = 0;
|
||||
start_sprite->add_int_pos({ MOVEx(256,start_sprite->int_ang() + 1024), MOVEy(256,start_sprite->int_ang() + 1024), 0 });
|
||||
start_sprite->spr.pos += DVector2(MOVEx(256,start_sprite->spr.angle + DAngle180), MOVEy(256,start_sprite->spr.angle + DAngle180));
|
||||
TrackAddPoint(t, tp, start_sprite);
|
||||
|
||||
// add climb point
|
||||
|
@ -499,7 +499,7 @@ void QuickLadderSetup(short stat, short lotag, short type)
|
|||
TrackAddPoint(t, tp, actor);
|
||||
|
||||
// add end point
|
||||
end_sprite->add_int_pos({ MOVEx(512,end_sprite->int_ang()), MOVEy(512,end_sprite->int_ang()), 0 });
|
||||
end_sprite->spr.pos += DVector2(MOVEx(512,end_sprite->spr.angle), MOVEy(512,end_sprite->spr.angle));
|
||||
end_sprite->spr.lotag = TRACK_END;
|
||||
end_sprite->spr.hitag = 0;
|
||||
TrackAddPoint(t, tp, end_sprite);
|
||||
|
@ -3263,7 +3263,6 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
if (actor->user.ActorActionSet->Jump)
|
||||
{
|
||||
int nx,ny;
|
||||
HitInfo near;
|
||||
|
||||
//
|
||||
|
@ -3279,18 +3278,19 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
// determine where the player is supposed to be in relation to the ladder
|
||||
// move out in front of the ladder
|
||||
nx = MOVEx(100, lActor->int_ang());
|
||||
ny = MOVEy(100, lActor->int_ang());
|
||||
double vx = MOVEx(100, lActor->spr.angle);
|
||||
double vy = MOVEy(100, lActor->spr.angle);
|
||||
|
||||
actor->set_int_xy(lActor->int_pos().X + nx, lActor->int_pos().Y + ny);
|
||||
actor->spr.pos.XY() = lActor->spr.pos.XY() + DVector2(vx, vy);
|
||||
|
||||
actor->set_int_ang(NORM_ANGLE(lActor->int_ang() + 1024));
|
||||
actor->spr.angle += DAngle180;
|
||||
|
||||
//
|
||||
// Get the z height to climb
|
||||
//
|
||||
|
||||
neartag({ actor->int_pos().X, actor->int_pos().Y, int_ActorZOfTop(actor) - (int_ActorSizeZ(actor) >> 1) }, actor->sector(), actor->int_ang(), near, 600, NTAG_SEARCH_LO_HI);
|
||||
double z = ActorZOfTop(actor) - (ActorSizeZ(actor) * 0.5);
|
||||
neartag(DVector3(actor->spr.pos.XY(), z), actor->sector(), actor->spr.angle, near, 600, NTAG_SEARCH_LO_HI);
|
||||
|
||||
if (near.hitWall == nullptr)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue