- floatified two SOP clipdist variables

This commit is contained in:
Christoph Oelckers 2022-09-30 18:14:37 +02:00
parent 69f27d42aa
commit f45acdc2a8
4 changed files with 12 additions and 12 deletions

View file

@ -1429,9 +1429,9 @@ struct SECTOR_OBJECT
track, // the track # 0 to 20
point, // the point on the track that the sector object is headed toward
vel_rate, // rate at which velocity aproaches target
dir, // direction traveling on the track
clipdist, // cliping distance for operational sector objects
clipbox_dist[MAX_CLIPBOX]; // mult-clip box variables (clipdist equivalent)
dir; // direction traveling on the track
double clipdist; // cliping distance for operational sector objects
double clipbox_dist[MAX_CLIPBOX]; // mult-clip box variables (clipdist equivalent)
double clipbox_vdist[MAX_CLIPBOX]; // mult-clip box variables
DAngle clipbox_ang[MAX_CLIPBOX]; // mult-clip box variables

View file

@ -65,7 +65,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
DVector2 vect = ang.ToVector() * sop->clipbox_vdist[i];
Collision coll;
clipmove(spos, &pp->cursector, vect, sop->clipbox_dist[i] * inttoworld, 4., floordist, CLIPMASK_PLAYER, coll, 1);
clipmove(spos, &pp->cursector, vect, sop->clipbox_dist[i], 4., floordist, CLIPMASK_PLAYER, coll, 1);
if (coll.type != kHitNone)
{
@ -96,7 +96,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
pos[i].Z = zz;
// move the box
clipmove(pos[i], &pp->cursector, pp->vect, sop->clipbox_dist[i] * inttoworld, 4., floordist, CLIPMASK_PLAYER, coll);
clipmove(pos[i], &pp->cursector, pp->vect, sop->clipbox_dist[i], 4., floordist, CLIPMASK_PLAYER, coll);
// save the dist moved
dist = (pos[i].XY() - opos[i].XY()).Length();
@ -138,7 +138,7 @@ int MultiClipTurn(PLAYER* pp, DAngle new_ang, double zz, double floordist)
DVector2 vect = ang.ToVector() * sop->clipbox_vdist[i];
Collision coll;
clipmove(spos, &cursect, vect, sop->clipbox_dist[i] * inttoworld, 4., floordist, CLIPMASK_PLAYER, coll);
clipmove(spos, &cursect, vect, sop->clipbox_dist[i], 4., floordist, CLIPMASK_PLAYER, coll);
ASSERT(cursect);

View file

@ -2784,7 +2784,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
if (pp->sop->clipdist)
{
Collision coll;
clipmove(pp->pos, &pp->cursector, pp->vect, pp->sop->clipdist * inttoworld, 4., floordist, CLIPMASK_PLAYER, actor->user.coll);
clipmove(pp->pos, &pp->cursector, pp->vect, pp->sop->clipdist, 4., floordist, CLIPMASK_PLAYER, actor->user.coll);
}
else
{

View file

@ -819,7 +819,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
case SO_CLIP_BOX:
{
sop->clipdist = 0;
sop->clipbox_dist[sop->clipbox_num] = itActor->spr.lotag;
sop->clipbox_dist[sop->clipbox_num] = itActor->spr.lotag * maptoworld;
sop->clipbox_vdist[sop->clipbox_num] = (sop->pmid.XY() - itActor->spr.pos.XY()).Length();
@ -960,7 +960,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
sop->spin_speed = nullAngle;
sop->spin_ang = nullAngle;
sop->ang_orig = nullAngle;
sop->clipdist = 1024;
sop->clipdist = 64;
sop->target_dist = 0;
sop->turn_speed = 4;
sop->floor_loz = -9999999;
@ -1093,7 +1093,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
sop->PreMoveAnimator = ScaleSectorObject;
sop->PostMoveAnimator = MorphTornado;
// clip
sop->clipdist = 2500;
sop->clipdist = 156.25;
// morph point
sop->morph_speed = 1;
sop->morph_z_speed = 6;
@ -1181,7 +1181,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
KillActor(actor);
break;
case SECT_SO_CLIP_DIST:
sop->clipdist = actor->spr.lotag;
sop->clipdist = actor->spr.lotag * maptoworld;
KillActor(actor);
break;
case SECT_SO_SPRITE_OBJ:
@ -2650,7 +2650,7 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
Collision coll;
auto vect = ang.ToVector() * sop->vel * inttoworld; // vel is still in Build coordinates.
clipmove(pos, &cursect, vect, sop->clipdist * inttoworld, 0., floor_dist, CLIPMASK_ACTOR, coll);
clipmove(pos, &cursect, vect, sop->clipdist, 0., floor_dist, CLIPMASK_ACTOR, coll);
if (coll.type != kHitNone)
{