- SW: Replace PLAYERstruct RevolveX with Revolve.X calls.

This commit is contained in:
Mitchell Richters 2021-12-30 17:42:34 +11:00
parent 05de974080
commit acc11f34bf
5 changed files with 10 additions and 9 deletions

View file

@ -663,7 +663,8 @@ struct PLAYERstruct
fixed_t recoil_ohorizoff, recoil_horizoff;
int oldposx,oldposy,oldposz;
int RevolveX, RevolveY;
vec3_t Revolve;
int RevolveY;
int16_t RevolveDeltaAng;
binangle RevolveAng;

View file

@ -7113,7 +7113,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_ohorizoff)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposx)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposy)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposz)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveX)
//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Revolve.X)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveY)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveDeltaAng)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, pnum)

View file

@ -492,7 +492,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
("oldposx", w.oldposx)
("oldposy", w.oldposy)
("oldposz", w.oldposz)
("revolvex", w.RevolveX)
("revolvex", w.Revolve.X)
("revolvey", w.RevolveY)
("RevolveDeltaAng", w.RevolveDeltaAng)
("RevolveAng", w.RevolveAng)

View file

@ -733,7 +733,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECTp sop)
if (pp->posx > xlow && pp->posx < xhigh && pp->posy > ylow && pp->posy < yhigh)
{
pp->RevolveAng = pp->angle.ang;
pp->RevolveX = pp->posx;
pp->Revolve.X = pp->pos.X;
pp->RevolveY = pp->posy;
pp->RevolveDeltaAng = 0;
pp->Flags |= (PF_PLAYER_RIDING);
@ -1524,7 +1524,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
pp->Flags |= (PF_PLAYER_RIDING);
pp->RevolveAng = pp->angle.ang;
pp->RevolveX = pp->pos.X;
pp->Revolve.X = pp->pos.X;
pp->RevolveY = pp->pos.Y;
// set the delta angle to 0 when moving
@ -1548,7 +1548,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// moving then you
// know where he was last
pp->RevolveAng = pp->angle.ang;
pp->RevolveX = pp->pos.X;
pp->Revolve.X = pp->pos.X;
pp->RevolveY = pp->pos.Y;
// set the delta angle to 0 when moving
@ -1559,7 +1559,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// Player is NOT moving
// Move saved x&y variables
pp->RevolveX += nx;
pp->Revolve.X += nx;
pp->RevolveY += ny;
// Last known angle is now adjusted by the delta angle
@ -1569,7 +1569,7 @@ void MovePlayer(PLAYERp pp, SECTOR_OBJECTp sop, int nx, int ny)
// increment Players delta angle
pp->RevolveDeltaAng = NORM_ANGLE(pp->RevolveDeltaAng + GlobSpeedSO);
rotatepoint(sop->pmid.vec2, *(vec2_t *)&pp->RevolveX, pp->RevolveDeltaAng, &pp->pos.vec2);
rotatepoint(sop->pmid.vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng, &pp->pos.vec2);
// THIS WAS CAUSING PROLEMS!!!!
// Sectors are still being manipulated so you can end up in a void (-1) sector

View file

@ -220,7 +220,7 @@ struct SWPlayer native
native int recoil_horizoff;
native int oldposx,oldposy,oldposz;
native int RevolveX, RevolveY;
native int RevolveY;
native int16 RevolveDeltaAng;
native int16 pnum; // carry along the player number