- replaced all possible __int_pmid with access functions.

This commit is contained in:
Christoph Oelckers 2022-08-18 18:27:31 +02:00
parent 819297a409
commit 48cbdeb697
8 changed files with 77 additions and 73 deletions

View file

@ -1440,7 +1440,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
if (TEST_BOOL1(ractor))
tang = ractor->spr.angle;
else
tang = VecToAngle(pp->sop_remote->__int_pmid.X - tx, pp->sop_remote->__int_pmid.Y - ty);
tang = VecToAngle(pp->sop_remote->int_pmid().X - tx, pp->sop_remote->int_pmid().Y - ty);
}
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))

View file

@ -1404,6 +1404,10 @@ extern TRACK Track[MAX_TRACKS];
struct SECTOR_OBJECT
{
vec3_t int_pmid() const
{
return __int_pmid;
}
soANIMATORp PreMoveAnimator;
soANIMATORp PostMoveAnimator;

View file

@ -310,8 +310,8 @@ void MorphTornado(SECTOR_OBJECT* sop)
return;
// place at correct x,y offset from center
x = sop->__int_pmid.X - sop->morph_xoff;
y = sop->__int_pmid.Y - sop->morph_yoff;
x = sop->int_pmid().X - sop->morph_xoff;
y = sop->int_pmid().Y - sop->morph_yoff;
sx = x;
sy = y;
@ -321,10 +321,10 @@ void MorphTornado(SECTOR_OBJECT* sop)
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
// bound check radius
if (ksqrt(SQ(sop->__int_pmid.X - mx) + SQ(sop->__int_pmid.Y - my)) > sop->morph_dist_max + sop->scale_dist)
if (ksqrt(SQ(sop->int_pmid().X - mx) + SQ(sop->int_pmid().Y - my)) > sop->morph_dist_max + sop->scale_dist)
{
// find angle
sop->morph_ang = NORM_ANGLE(getangle(mx - sop->__int_pmid.X, my - sop->__int_pmid.Y));
sop->morph_ang = NORM_ANGLE(getangle(mx - sop->int_pmid().X, my - sop->int_pmid().Y));
// reverse angle
sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024);
@ -332,13 +332,13 @@ void MorphTornado(SECTOR_OBJECT* sop)
mx = sx + MulScale(sop->morph_speed << 1, bcos(sop->morph_ang), 14);
my = sy + MulScale(sop->morph_speed << 1, bsin(sop->morph_ang), 14);
sop->morph_xoff = sop->__int_pmid.X - mx;
sop->morph_yoff = sop->__int_pmid.Y - my;
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
}
// save x,y back as offset info
sop->morph_xoff = sop->__int_pmid.X - mx;
sop->morph_yoff = sop->__int_pmid.Y - my;
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
if ((RANDOM_P2(1024<<4)>>4) < sop->morph_rand_freq)
sop->morph_ang = RANDOM_P2(2048);
@ -390,19 +390,19 @@ void MorphFloor(SECTOR_OBJECT* sop)
return;
// place at correct x,y offset from center
x = sop->__int_pmid.X - sop->morph_xoff;
y = sop->__int_pmid.Y - sop->morph_yoff;
x = sop->int_pmid().X - sop->morph_xoff;
y = sop->int_pmid().Y - sop->morph_yoff;
// move it from last x,y
mx = x + MulScale(sop->morph_speed, bcos(sop->morph_ang), 14);
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
// save x,y back as offset info
sop->morph_xoff = sop->__int_pmid.X - mx;
sop->morph_yoff = sop->__int_pmid.Y - my;
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
// bound check radius
if (Distance(sop->__int_pmid.X, sop->__int_pmid.Y, mx, my) > sop->morph_dist_max)
if (Distance(sop->int_pmid().X, sop->int_pmid().Y, mx, my) > sop->morph_dist_max)
{
// go in the other direction
//sop->morph_speed *= -1;
@ -411,8 +411,8 @@ void MorphFloor(SECTOR_OBJECT* sop)
// back it up and save it off
mx = x + MulScale(sop->morph_speed, bcos(sop->morph_ang), 14);
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
sop->morph_xoff = sop->__int_pmid.X - mx;
sop->morph_yoff = sop->__int_pmid.Y - my;
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
// turn it all the way around and then do a random -512 to 512 from there
//sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024 + (RANDOM_P2(1024) - 512));
@ -514,8 +514,8 @@ void SpikeFloor(SECTOR_OBJECT* sop)
return;
// place at correct x,y offset from center
x = sop->__int_pmid.X - sop->morph_xoff;
y = sop->__int_pmid.Y - sop->morph_yoff;
x = sop->int_pmid().X - sop->morph_xoff;
y = sop->int_pmid().Y - sop->morph_yoff;
// move it from last x,y
mx = x;

View file

@ -1566,7 +1566,7 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel)
pp->actor->set_int_ang(pp->angle.ang.Buildang());
}
OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), pp->sop->__int_pmid.X, pp->sop->__int_pmid.Y);
OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), pp->sop->int_pmid().X, pp->sop->int_pmid().Y);
}
void SlipSlope(PLAYER* pp)
@ -2567,8 +2567,8 @@ void DoPlayerMoveVehicle(PLAYER* pp)
x[count] = wal.wall_int_pos().X;
y[count] = wal.wall_int_pos().Y;
ox[count] = sop->__int_pmid.X - sop->xorig[wallcount];
oy[count] = sop->__int_pmid.Y - sop->yorig[wallcount];
ox[count] = sop->int_pmid().X - sop->xorig[wallcount];
oy[count] = sop->int_pmid().Y - sop->yorig[wallcount];
count++;
}
@ -4821,15 +4821,15 @@ void FindMainSector(SECTOR_OBJECT* sop)
// find the main sector - only do this once for each sector object
if (sop->op_main_sector == nullptr)
{
int sx = sop->__int_pmid.X;
int sy = sop->__int_pmid.Y;
int sx = sop->int_pmid().X;
int sy = sop->int_pmid().Y;
PlaceSectorObject(sop, MAXSO, MAXSO);
// set it to something valid
sop->op_main_sector = &sector[0];
updatesectorz(sx, sy, sop->__int_pmid.Z, &sop->op_main_sector);
updatesectorz(sx, sy, sop->int_pmid().Z, &sop->op_main_sector);
PlaceSectorObject(sop, sx, sy);
}
@ -4902,8 +4902,8 @@ void DoPlayerBeginOperate(PLAYER* pp)
sop->controller = pp->actor;
pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang);
pp->pos.X = sop->__int_pmid.X;
pp->pos.Y = sop->__int_pmid.Y;
pp->pos.X = sop->int_pmid().X;
pp->pos.Y = sop->int_pmid().Y;
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz);
pp->pos.Z = fz - PLAYER_HEIGHT;
@ -4987,8 +4987,8 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop)
auto save_sect = pp->cursector;
pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang);
pp->pos.X = sop->__int_pmid.X;
pp->pos.Y = sop->__int_pmid.Y;
pp->pos.X = sop->int_pmid().X;
pp->pos.Y = sop->int_pmid().Y;
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz);
pp->pos.Z = fz - PLAYER_HEIGHT;
@ -5111,7 +5111,7 @@ void DoPlayerStopOperate(PLAYER* pp)
if (TEST_BOOL1(rsp))
pp->angle.ang = pp->angle.oang = rsp->spr.angle;
else
pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->__int_pmid.X - pp->pos.X, pp->sop_remote->__int_pmid.Y - pp->pos.Y);
pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->int_pmid().X - pp->pos.X, pp->sop_remote->int_pmid().Y - pp->pos.Y);
}
if (pp->sop_control)

View file

@ -1066,7 +1066,7 @@ bool TestKillSectorObject(SECTOR_OBJECT* sop)
{
KillMatchingCrackSprites(sop->match_event);
// get new sectnums
CollapseSectorObject(sop, sop->__int_pmid.X, sop->__int_pmid.Y);
CollapseSectorObject(sop, sop->int_pmid().X, sop->int_pmid().Y);
DoSpawnSpotsForKill(sop->match_event);
KillSectorObjectSprites(sop);
return true;
@ -2665,7 +2665,7 @@ void DoSector(void)
}
else
{
DISTANCE(pp->pos.X, pp->pos.Y, sop->__int_pmid.X, sop->__int_pmid.Y, dist, a, b, c);
DISTANCE(pp->pos.X, pp->pos.Y, sop->int_pmid().X, sop->int_pmid().Y, dist, a, b, c);
if (dist < min_dist)
min_dist = dist;
}

View file

@ -605,7 +605,7 @@ void GameInterface::UpdateSounds(void)
if (TEST_BOOL1(rsp))
tang = rsp->spr.angle;
else
tang = VecToAngle(pp->sop_remote->__int_pmid.X - pp->pos.X, pp->sop_remote->__int_pmid.Y - pp->pos.Y);
tang = VecToAngle(pp->sop_remote->int_pmid().X - pp->pos.X, pp->sop_remote->int_pmid().Y - pp->pos.Y);
}
else tang = pp->angle.ang;

View file

@ -846,12 +846,12 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
short ang2;
sop->clipdist = 0;
sop->clipbox_dist[sop->clipbox_num] = itActor->spr.lotag;
sop->clipbox_xoff[sop->clipbox_num] = sop->__int_pmid.X - itActor->int_pos().X;
sop->clipbox_yoff[sop->clipbox_num] = sop->__int_pmid.Y - itActor->int_pos().Y;
sop->clipbox_xoff[sop->clipbox_num] = sop->int_pmid().X - itActor->int_pos().X;
sop->clipbox_yoff[sop->clipbox_num] = sop->int_pmid().Y - itActor->int_pos().Y;
sop->clipbox_vdist[sop->clipbox_num] = ksqrt(SQ(sop->__int_pmid.X - itActor->int_pos().X) + SQ(sop->__int_pmid.Y - itActor->int_pos().Y));
sop->clipbox_vdist[sop->clipbox_num] = ksqrt(SQ(sop->int_pmid().X - itActor->int_pos().X) + SQ(sop->int_pmid().Y - itActor->int_pos().Y));
ang2 = getangle(itActor->int_pos().X - sop->__int_pmid.X, itActor->int_pos().Y - sop->__int_pmid.Y);
ang2 = getangle(itActor->int_pos().X - sop->int_pmid().X, itActor->int_pos().Y - sop->int_pmid().Y);
sop->clipbox_ang[sop->clipbox_num] = getincangle(ang2, sop->ang);
sop->clipbox_num++;
@ -872,8 +872,8 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
}
itActor->user.pos.X = sop->__int_pmid.X - itActor->int_pos().X;
itActor->user.pos.Y = sop->__int_pmid.Y - itActor->int_pos().Y;
itActor->user.pos.X = sop->int_pmid().X - itActor->int_pos().X;
itActor->user.pos.Y = sop->int_pmid().Y - itActor->int_pos().Y;
itActor->user.pos.Z = sop->mid_sector->int_floorz() - itActor->int_pos().Z;
itActor->user.Flags |= (SPR_SO_ATTACHED);
@ -939,7 +939,7 @@ cont:
for (i = 0; sop->so_actors[i] != nullptr; i++)
{
auto actor = sop->so_actors[i];
actor->user.pos.Z = sop->__int_pmid.Z - actor->int_pos().Z;
actor->user.pos.Z = sop->int_pmid().Z - actor->int_pos().Z;
}
}
}
@ -1035,7 +1035,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
// spawn a sprite to make it easier to integrate with sprite routines
auto actorNew = SpawnActor(STAT_SO_SP_CHILD, 0, nullptr, sectp,
sop->__int_pmid.X, sop->__int_pmid.Y, sop->__int_pmid.Z, 0, 0);
sop->int_pmid().X, sop->int_pmid().Y, sop->int_pmid().Z, 0, 0);
sop->sp_child = actorNew;
actorNew->user.sop_parent = sop;
actorNew->user.Flags2 |= (SPR2_SPRITE_FAKE_BLOCK); // for damage test
@ -1391,8 +1391,8 @@ void PlaceSectorObjectsOnTracks(void)
// move all walls in sectors
for (auto& wal : wallsofsector(sop->sectp[j]))
{
sop->xorig[sop->num_walls] = sop->__int_pmid.X - wal.wall_int_pos().X;
sop->yorig[sop->num_walls] = sop->__int_pmid.Y - wal.wall_int_pos().Y;
sop->xorig[sop->num_walls] = sop->int_pmid().X - wal.wall_int_pos().X;
sop->yorig[sop->num_walls] = sop->int_pmid().Y - wal.wall_int_pos().Y;
sop->num_walls++;
}
}
@ -1411,7 +1411,7 @@ void PlaceSectorObjectsOnTracks(void)
{
tpoint = Track[sop->track].TrackPoint;
dist = Distance((tpoint + j)->x, (tpoint + j)->y, sop->__int_pmid.X, sop->__int_pmid.Y);
dist = Distance((tpoint + j)->x, (tpoint + j)->y, sop->int_pmid().X, sop->int_pmid().Y);
if (dist < low_dist)
{
@ -1429,7 +1429,7 @@ void PlaceSectorObjectsOnTracks(void)
NextTrackPoint(sop);
sop->ang = getangle((tpoint + sop->point)->x - sop->__int_pmid.X, (tpoint + sop->point)->y - sop->__int_pmid.Y);
sop->ang = getangle((tpoint + sop->point)->x - sop->int_pmid().X, (tpoint + sop->point)->y - sop->int_pmid().Y);
sop->ang_moving = sop->ang_tgt = sop->ang;
}
@ -1560,7 +1560,7 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny)
// increment Players delta angle
pp->RevolveDeltaAng = (pp->RevolveDeltaAng + GlobSpeedSO).Normalized360();
rotatepoint(sop->__int_pmid.vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng.Buildang(), &pp->pos.vec2);
rotatepoint(sop->int_pmid().vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng.Buildang(), &pp->pos.vec2);
// THIS WAS CAUSING PROLEMS!!!!
// Sectors are still being manipulated so you can end up in a void (-1) sector
@ -1582,25 +1582,25 @@ void MovePoints(SECTOR_OBJECT* sop, short delta_ang, int nx, int ny)
int i, rot_ang;
bool PlayerMove = true;
if (sop->__int_pmid.X >= MAXSO)
if (sop->int_pmid().X >= MAXSO)
PlayerMove = false;
// move along little midpoint
sop->__int_pmid.X += nx;
sop->__int_pmid.Y += ny;
if (sop->__int_pmid.X >= MAXSO)
if (sop->int_pmid().X >= MAXSO)
PlayerMove = false;
// move child sprite along also
sop->sp_child->set_int_xy(sop->__int_pmid.X, sop->__int_pmid.Y);
sop->sp_child->set_int_xy(sop->int_pmid().X, sop->int_pmid().Y);
// setting floor z if need be
if ((sop->flags & SOBJ_ZMID_FLOOR))
sop->__int_pmid.Z = sop->mid_sector->int_floorz();
DVector2 pivot = { sop->__int_pmid.X * inttoworld, sop->__int_pmid.Y * inttoworld };
DVector2 pivot = { sop->int_pmid().X * inttoworld, sop->int_pmid().Y * inttoworld};
DVector2 move = { nx * inttoworld, ny * inttoworld };
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{
@ -1693,13 +1693,13 @@ PlayerPart:
}
}
actor->set_int_xy(sop->__int_pmid.X - actor->user.pos.X, sop->__int_pmid.Y - actor->user.pos.Y);
actor->set_int_xy(sop->int_pmid().X - actor->user.pos.X, sop->int_pmid().Y - actor->user.pos.Y);
// sprites z update
if ((sop->flags & SOBJ_SPRITE_OBJ))
{
// Sprite Objects follow zmid
actor->set_int_z(sop->__int_pmid.Z - actor->user.pos.Z);
actor->set_int_z(sop->int_pmid().Z - actor->user.pos.Z);
}
else
{
@ -1732,12 +1732,12 @@ PlayerPart:
auto pos = actor->int_pos();
if ((actor->sector()->firstWall()->extra & WALLFX_LOOP_REVERSE_SPIN))
{
rotatepoint(sop->__int_pmid.vec2, actor->int_pos().vec2, -delta_ang, &pos.vec2);
rotatepoint(sop->int_pmid().vec2, actor->int_pos().vec2, -delta_ang, &pos.vec2);
actor->set_int_ang(NORM_ANGLE(actor->int_ang() - delta_ang));
}
else
{
rotatepoint(sop->__int_pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
rotatepoint(sop->int_pmid().vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + delta_ang));
}
actor->set_int_pos(pos);
@ -1749,14 +1749,14 @@ PlayerPart:
{
// NOT part of a sector - independant of any sector
auto pos = actor->int_pos();
rotatepoint(sop->__int_pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
rotatepoint(sop->int_pmid().vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + delta_ang));
actor->set_int_pos(pos);
}
// Does not necessarily move with the sector so must accout for
// moving across sectors
if (sop->__int_pmid.X < MAXSO) // special case for operating SO's
if (sop->int_pmid().X < MAXSO) // special case for operating SO's
SetActorZ(sop->so_actors[i], actor->int_pos());
}
@ -1833,14 +1833,14 @@ void RefreshPoints(SECTOR_OBJECT* sop, int nx, int ny, bool dynamic)
{
if (!(wal.extra && (wal.extra & WALLFX_DONT_MOVE)))
{
dx = x = sop->__int_pmid.X - sop->xorig[wallcount];
dy = y = sop->__int_pmid.Y - sop->yorig[wallcount];
dx = x = sop->int_pmid().X - sop->xorig[wallcount];
dy = y = sop->int_pmid().Y - sop->yorig[wallcount];
if (dynamic && sop->scale_type)
{
if (!(wal.extra & WALLFX_DONT_SCALE))
{
ang = NORM_ANGLE(getangle(x - sop->__int_pmid.X, y - sop->__int_pmid.Y));
ang = NORM_ANGLE(getangle(x - sop->int_pmid().X, y - sop->int_pmid().Y));
if (sop->scale_type == SO_SCALE_RANDOM_POINT)
{
@ -2242,7 +2242,7 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
// calculate an angle to the target
if (sop->vel)
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->__int_pmid.X, tpoint->y - sop->__int_pmid.Y);
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->int_pmid().X, tpoint->y - sop->int_pmid().Y);
// NOTE: Jittery ride - try new value out here
// NOTE: Put a loop around this (locktics) to make it more acuruate
@ -2498,10 +2498,10 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
tpoint = Track[sop->track].TrackPoint + sop->point;
// calculate distance to target poing
sop->target_dist = Distance(sop->__int_pmid.X, sop->__int_pmid.Y, tpoint->x, tpoint->y);
sop->target_dist = Distance(sop->int_pmid().X, sop->int_pmid().Y, tpoint->x, tpoint->y);
// calculate a new angle to the target
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->__int_pmid.X, tpoint->y - sop->__int_pmid.Y);
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->int_pmid().X, tpoint->y - sop->int_pmid().Y);
if ((sop->flags & SOBJ_ZDIFF_MODE))
{
@ -2513,11 +2513,11 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
dz = tpoint->z - sop->zdelta;
// find the distance to the target (player)
dist = DIST(dx, dy, sop->__int_pmid.X, sop->__int_pmid.Y);
dist = DIST(dx, dy, sop->int_pmid().X, sop->int_pmid().Y);
// (velocity * difference between the target and the object)
// / distance
sop->z_rate = (sop->vel * (sop->__int_pmid.Z - dz)) / dist;
sop->z_rate = (sop->vel * (sop->int_pmid().Z - dz)) / dist;
// take absolute value and convert to pixels (divide by 256)
sop->z_rate = PIXZ(labs(sop->z_rate));
@ -2565,7 +2565,7 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
*nx = ((sop->vel) >> 8) * locktics * bcos(sop->ang_moving) >> 14;
*ny = ((sop->vel) >> 8) * locktics * bsin(sop->ang_moving) >> 14;
dist = Distance(sop->__int_pmid.X, sop->__int_pmid.Y, sop->__int_pmid.X + *nx, sop->__int_pmid.Y + *ny);
dist = Distance(sop->int_pmid().X, sop->int_pmid().Y, sop->int_pmid().X + *nx, sop->int_pmid().Y + *ny);
sop->target_dist -= dist;
}
}
@ -2607,7 +2607,7 @@ void OperateSectorObjectForTics(SECTOR_OBJECT* sop, short newang, int newx, int
sop->spin_ang = 0;
sop->ang = newang;
RefreshPoints(sop, newx - sop->__int_pmid.X, newy - sop->__int_pmid.Y, false);
RefreshPoints(sop, newx - sop->int_pmid().X, newy - sop->int_pmid().Y, false);
}
void OperateSectorObject(SECTOR_OBJECT* sop, short newang, int newx, int newy)
@ -2618,7 +2618,7 @@ void OperateSectorObject(SECTOR_OBJECT* sop, short newang, int newx, int newy)
void PlaceSectorObject(SECTOR_OBJECT* sop, int newx, int newy)
{
so_setinterpolationtics(sop, synctics);
RefreshPoints(sop, newx - sop->__int_pmid.X, newy - sop->__int_pmid.Y, false);
RefreshPoints(sop, newx - sop->int_pmid().X, newy - sop->int_pmid().Y, false);
}
void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator)
@ -2706,8 +2706,8 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
auto cursect = sop->op_main_sector; // for sop->vel
floor_dist = (abs(cursect->int_ceilingz() - cursect->int_floorz())) >> 2;
pos.X = sop->__int_pmid.X;
pos.Y = sop->__int_pmid.Y;
pos.X = sop->int_pmid().X;
pos.Y = sop->int_pmid().Y;
pos.Z = floor_dist;
PlaceSectorObject(sop, MAXSO, MAXSO);
@ -2720,7 +2720,7 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
}
TornadoSpin(sop);
RefreshPoints(sop, pos.X - sop->__int_pmid.X, pos.Y - sop->__int_pmid.Y, true);
RefreshPoints(sop, pos.X - sop->int_pmid().X, pos.Y - sop->int_pmid().Y, true);
}
void DoAutoTurretObject(SECTOR_OBJECT* sop)
@ -2790,7 +2790,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
}
}
sop->ang_tgt = getangle(actor->user.targetActor->int_pos().X - sop->__int_pmid.X, actor->user.targetActor->int_pos().Y - sop->__int_pmid.Y);
sop->ang_tgt = getangle(actor->user.targetActor->int_pos().X - sop->int_pmid().X, actor->user.targetActor->int_pos().Y - sop->int_pmid().Y);
// get delta to target angle
delta_ang = getincangle(sop->ang, sop->ang_tgt);
@ -2813,7 +2813,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
}
}
OperateSectorObjectForTics(sop, sop->ang, sop->__int_pmid.X, sop->__int_pmid.Y, 2*synctics);
OperateSectorObjectForTics(sop, sop->ang, sop->int_pmid().X, sop->int_pmid().Y, 2*synctics);
}
}

View file

@ -10210,8 +10210,8 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECT* sop)
actor->user.Flags |= (SPR_ON_SO_SECTOR|SPR_SO_ATTACHED);
actor->user.pos.X = sop->__int_pmid.X - actor->int_pos().X;
actor->user.pos.Y = sop->__int_pmid.Y - actor->int_pos().Y;
actor->user.pos.X = sop->int_pmid().X - actor->int_pos().X;
actor->user.pos.Y = sop->int_pmid().Y - actor->int_pos().Y;
actor->user.pos.Z = sop->mid_sector->int_floorz() - actor->int_pos().Z;
actor->user.sang = actor->int_ang();