- SW: Replace PLAYERstruct xvect with vect.X calls.

This commit is contained in:
Mitchell Richters 2021-12-30 23:45:46 +11:00
parent 03da70b3b9
commit f2497d7d08
8 changed files with 61 additions and 60 deletions

View file

@ -631,7 +631,8 @@ struct PLAYERstruct
vec3_t si; // save player interp position for PlayerSprite vec3_t si; // save player interp position for PlayerSprite
int16_t siang; int16_t siang;
int xvect, yvect; vec2_t vect;
int yvect;
int oxvect, oyvect; int oxvect, oyvect;
int friction; int friction;
int slide_xvect, slide_yvect; int slide_xvect, slide_yvect;
@ -2139,7 +2140,7 @@ inline bool SpriteInUnderwaterArea(DSWActor* a)
// just determine if the player is moving // just determine if the player is moving
inline bool PLAYER_MOVING(PLAYERp pp) inline bool PLAYER_MOVING(PLAYERp pp)
{ {
return (pp->xvect | pp->yvect); return (pp->vect.X | pp->yvect);
} }
inline void PlaySound(int num, DSWActor* actor, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) inline void PlaySound(int num, DSWActor* actor, Voc3D_Flags flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)

View file

@ -1295,7 +1295,7 @@ int PlayerInitChemBomb(PLAYERp pp)
actorNew->user.zchange = actorNew->spr.zvel >> 1; actorNew->user.zchange = actorNew->spr.zvel >> 1;
// adjust xvel according to player velocity // adjust xvel according to player velocity
actorNew->user.xchange += pp->xvect >> 14; actorNew->user.xchange += pp->vect.X >> 14;
actorNew->user.ychange += pp->yvect >> 14; actorNew->user.ychange += pp->yvect >> 14;
// Smoke will come out for this many seconds // Smoke will come out for this many seconds
@ -1667,7 +1667,7 @@ int PlayerInitCaltrops(PLAYERp pp)
actorNew->user.zchange = actorNew->spr.zvel >> 1; actorNew->user.zchange = actorNew->spr.zvel >> 1;
// adjust xvel according to player velocity // adjust xvel according to player velocity
actorNew->user.xchange += pp->xvect >> 14; actorNew->user.xchange += pp->vect.X >> 14;
actorNew->user.ychange += pp->yvect >> 14; actorNew->user.ychange += pp->yvect >> 14;
SetupSpriteForBreak(actorNew); // Put Caltrops in the break queue SetupSpriteForBreak(actorNew); // Put Caltrops in the break queue

View file

@ -96,7 +96,7 @@ Collision MultiClipMove(PLAYERp pp, int z, int floor_dist)
pos[i].Z = z; pos[i].Z = z;
// move the box // move the box
clipmove(pos[i], &pp->cursector, pp->xvect, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll); clipmove(pos[i], &pp->cursector, pp->vect.X, pp->yvect, (int)sop->clipbox_dist[i], Z(4), floor_dist, CLIPMASK_PLAYER, coll);
// save the dist moved // save the dist moved
dist = ksqrt(SQ(pos[i].X - opos[i].X) + SQ(pos[i].Y - opos[i].Y)); dist = ksqrt(SQ(pos[i].X - opos[i].X) + SQ(pos[i].Y - opos[i].Y));
@ -194,14 +194,14 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
xy[i].X = qx[i] + (pp->xvect>>14); xy[i].X = qx[i] + (pp->vect.X>>14);
xy[i].Y = qy[i] + (pp->yvect>>14); xy[i].Y = qy[i] + (pp->yvect>>14);
} }
//Given the 4 points: x[4], y[4] //Given the 4 points: x[4], y[4]
if (testquadinsect(&point_num, xy, pp->cursector)) if (testquadinsect(&point_num, xy, pp->cursector))
{ {
pp->pos.X += (pp->xvect>>14); pp->pos.X += (pp->vect.X>>14);
pp->pos.Y += (pp->yvect>>14); pp->pos.Y += (pp->yvect>>14);
return true; return true;
} }
@ -214,12 +214,12 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
xy[i].X = qx[i] - (pp->yvect>>15); xy[i].X = qx[i] - (pp->yvect>>15);
xy[i].Y = qy[i] + (pp->xvect>>15); xy[i].Y = qy[i] + (pp->vect.X>>15);
} }
if (testquadinsect(&point_num, xy, pp->cursector)) if (testquadinsect(&point_num, xy, pp->cursector))
{ {
pp->pos.X -= (pp->yvect>>15); pp->pos.X -= (pp->yvect>>15);
pp->pos.Y += (pp->xvect>>15); pp->pos.Y += (pp->vect.X>>15);
} }
return false; return false;
@ -230,12 +230,12 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
xy[i].X = qx[i] + (pp->yvect>>15); xy[i].X = qx[i] + (pp->yvect>>15);
xy[i].Y = qy[i] - (pp->xvect>>15); xy[i].Y = qy[i] - (pp->vect.X>>15);
} }
if (testquadinsect(&point_num, xy, pp->cursector)) if (testquadinsect(&point_num, xy, pp->cursector))
{ {
pp->pos.X += (pp->yvect>>15); pp->pos.X += (pp->yvect>>15);
pp->pos.Y -= (pp->xvect>>15); pp->pos.Y -= (pp->vect.X>>15);
} }
return false; return false;

View file

@ -6312,7 +6312,7 @@ void pWeaponBob(PANEL_SPRITEp psp, short condition)
{ {
double xdiff = 0, ydiff = 0; double xdiff = 0, ydiff = 0;
double bobvel = fFindDistance2D(psp->PlayerP->xvect, psp->PlayerP->yvect) * (1. / 32768.); double bobvel = fFindDistance2D(psp->PlayerP->vect.X, psp->PlayerP->yvect) * (1. / 32768.);
bobvel = bobvel + (bobvel * (1. / 4.)); bobvel = bobvel + (bobvel * (1. / 4.));
bobvel = min(bobvel, 128.); bobvel = min(bobvel, 128.);

View file

@ -1243,7 +1243,7 @@ DSWActor* DoPickTarget(DSWActor* actor, uint32_t max_delta_ang, int skip_targets
void DoPlayerResetMovement(PLAYERp pp) void DoPlayerResetMovement(PLAYERp pp)
{ {
pp->xvect = pp->oxvect = 0; pp->vect.X = pp->oxvect = 0;
pp->yvect = pp->oxvect = 0; pp->yvect = pp->oxvect = 0;
pp->slide_xvect = 0; pp->slide_xvect = 0;
pp->slide_yvect = 0; pp->slide_yvect = 0;
@ -1581,7 +1581,7 @@ void SlipSlope(PLAYERp pp)
ang = NORM_ANGLE(ang + 512); ang = NORM_ANGLE(ang + 512);
pp->xvect += MulScale(bcos(ang), pp->cursector->floorheinum, sectu->speed); pp->vect.X += MulScale(bcos(ang), pp->cursector->floorheinum, sectu->speed);
pp->yvect += MulScale(bsin(ang), pp->cursector->floorheinum, sectu->speed); pp->yvect += MulScale(bsin(ang), pp->cursector->floorheinum, sectu->speed);
} }
@ -2011,10 +2011,10 @@ void DoPlayerMove(PLAYERp pp)
DoPlayerSlide(pp); DoPlayerSlide(pp);
pp->oxvect = pp->xvect; pp->oxvect = pp->vect.X;
pp->oyvect = pp->yvect; pp->oyvect = pp->yvect;
pp->xvect += ((pp->input.fvel*synctics*2)<<6); pp->vect.X += ((pp->input.fvel*synctics*2)<<6);
pp->yvect += ((pp->input.svel*synctics*2)<<6); pp->yvect += ((pp->input.svel*synctics*2)<<6);
friction = pp->friction; friction = pp->friction;
@ -2023,26 +2023,26 @@ void DoPlayerMove(PLAYERp pp)
friction -= pp->WadeDepth * 100L; friction -= pp->WadeDepth * 100L;
} }
pp->xvect = MulScale(pp->xvect, friction, 16); pp->vect.X = MulScale(pp->vect.X, friction, 16);
pp->yvect = MulScale(pp->yvect, friction, 16); pp->yvect = MulScale(pp->yvect, friction, 16);
if (pp->Flags & (PF_FLYING)) if (pp->Flags & (PF_FLYING))
{ {
// do a bit of weighted averaging // do a bit of weighted averaging
pp->xvect = (pp->xvect + (pp->oxvect*1))/2; pp->vect.X = (pp->vect.X + (pp->oxvect*1))/2;
pp->yvect = (pp->yvect + (pp->oyvect*1))/2; pp->yvect = (pp->yvect + (pp->oyvect*1))/2;
} }
else if (pp->Flags & (PF_DIVING)) else if (pp->Flags & (PF_DIVING))
{ {
// do a bit of weighted averaging // do a bit of weighted averaging
pp->xvect = (pp->xvect + (pp->oxvect*2))/3; pp->vect.X = (pp->vect.X + (pp->oxvect*2))/3;
pp->yvect = (pp->yvect + (pp->oyvect*2))/3; pp->yvect = (pp->yvect + (pp->oyvect*2))/3;
} }
if (labs(pp->xvect) < 12800 && labs(pp->yvect) < 12800) if (labs(pp->vect.X) < 12800 && labs(pp->yvect) < 12800)
pp->xvect = pp->yvect = 0; pp->vect.X = pp->yvect = 0;
actor->spr.xvel = FindDistance2D(pp->xvect,pp->yvect)>>14; actor->spr.xvel = FindDistance2D(pp->vect.X,pp->yvect)>>14;
if (pp->Flags & (PF_CLIP_CHEAT)) if (pp->Flags & (PF_CLIP_CHEAT))
{ {
@ -2052,7 +2052,7 @@ void DoPlayerMove(PLAYERp pp)
pp->opos.X = pp->pos.X; pp->opos.X = pp->pos.X;
pp->opos.Y = pp->pos.Y; pp->opos.Y = pp->pos.Y;
} }
pp->pos.X += pp->xvect >> 14; pp->pos.X += pp->vect.X >> 14;
pp->pos.Y += pp->yvect >> 14; pp->pos.Y += pp->yvect >> 14;
updatesector(pp->pos.X, pp->pos.Y, &sect); updatesector(pp->pos.X, pp->pos.Y, &sect);
if (sect != nullptr) if (sect != nullptr)
@ -2084,7 +2084,7 @@ void DoPlayerMove(PLAYERp pp)
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
Collision coll; Collision coll;
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector); updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
clipmove(pp->pos, &pp->cursector, pp->xvect, pp->yvect, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll); clipmove(pp->pos, &pp->cursector, pp->vect.X, pp->yvect, ((int)actor->spr.clipdist<<2), pp->ceiling_dist, pp->floor_dist, CLIPMASK_PLAYER, coll);
actor->spr.cstat = save_cstat; actor->spr.cstat = save_cstat;
PlayerCheckValidMove(pp); PlayerCheckValidMove(pp);
@ -2255,8 +2255,8 @@ void DoTankTreads(PLAYERp pp)
if (Prediction) if (Prediction)
return; return;
vel = FindDistance2D(pp->xvect>>8, pp->yvect>>8); vel = FindDistance2D(pp->vect.X>>8, pp->yvect>>8);
dot = DOT_PRODUCT_2D(pp->xvect, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin()); dot = DOT_PRODUCT_2D(pp->vect.X, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin());
if (dot < 0) if (dot < 0)
reverse = true; reverse = true;
@ -2367,7 +2367,7 @@ void DriveCrush(PLAYERp pp, int *x, int *y)
return; return;
// not moving - don't crush // not moving - don't crush
if ((pp->xvect|pp->yvect) == 0 && pp->input.avel == 0) if ((pp->vect.X|pp->yvect) == 0 && pp->input.avel == 0)
return; return;
// main sector // main sector
@ -2415,10 +2415,10 @@ void DriveCrush(PLAYERp pp, int *x, int *y)
if (actor->spr.pos.Z < sop->crush_z) if (actor->spr.pos.Z < sop->crush_z)
continue; continue;
int32_t const vel = FindDistance2D(pp->xvect>>8, pp->yvect>>8); int32_t const vel = FindDistance2D(pp->vect.X>>8, pp->yvect>>8);
if (vel < 9000) if (vel < 9000)
{ {
DoActorBeginSlide(actor, getangle(pp->xvect, pp->yvect), vel/8, 5); DoActorBeginSlide(actor, getangle(pp->vect.X, pp->yvect), vel/8, 5);
if (DoActorSlide(actor)) if (DoActorSlide(actor))
continue; continue;
} }
@ -2536,32 +2536,32 @@ void DoPlayerMoveVehicle(PLAYERp pp)
else else
pp->Flags |= (PF_PLAYER_MOVED); pp->Flags |= (PF_PLAYER_MOVED);
pp->oxvect = pp->xvect; pp->oxvect = pp->vect.X;
pp->oyvect = pp->yvect; pp->oyvect = pp->yvect;
if (sop->drive_speed) if (sop->drive_speed)
{ {
pp->xvect = MulScale(pp->input.fvel, sop->drive_speed, 6); pp->vect.X = MulScale(pp->input.fvel, sop->drive_speed, 6);
pp->yvect = MulScale(pp->input.svel, sop->drive_speed, 6); pp->yvect = MulScale(pp->input.svel, sop->drive_speed, 6);
// does sliding/momentum // does sliding/momentum
pp->xvect = (pp->xvect + (pp->oxvect*(sop->drive_slide-1)))/sop->drive_slide; pp->vect.X = (pp->vect.X + (pp->oxvect*(sop->drive_slide-1)))/sop->drive_slide;
pp->yvect = (pp->yvect + (pp->oyvect*(sop->drive_slide-1)))/sop->drive_slide; pp->yvect = (pp->yvect + (pp->oyvect*(sop->drive_slide-1)))/sop->drive_slide;
} }
else else
{ {
pp->xvect += ((pp->input.fvel*synctics*2)<<6); pp->vect.X += ((pp->input.fvel*synctics*2)<<6);
pp->yvect += ((pp->input.svel*synctics*2)<<6); pp->yvect += ((pp->input.svel*synctics*2)<<6);
pp->xvect = MulScale(pp->xvect, TANK_FRICTION, 16); pp->vect.X = MulScale(pp->vect.X, TANK_FRICTION, 16);
pp->yvect = MulScale(pp->yvect, TANK_FRICTION, 16); pp->yvect = MulScale(pp->yvect, TANK_FRICTION, 16);
pp->xvect = (pp->xvect + (pp->oxvect*1))/2; pp->vect.X = (pp->vect.X + (pp->oxvect*1))/2;
pp->yvect = (pp->yvect + (pp->oyvect*1))/2; pp->yvect = (pp->yvect + (pp->oyvect*1))/2;
} }
if (labs(pp->xvect) < 12800 && labs(pp->yvect) < 12800) if (labs(pp->vect.X) < 12800 && labs(pp->yvect) < 12800)
pp->xvect = pp->yvect = 0; pp->vect.X = pp->yvect = 0;
pp->lastcursector = pp->cursector; pp->lastcursector = pp->cursector;
z = pp->pos.Z + Z(10); z = pp->pos.Z + Z(10);
@ -2613,7 +2613,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
if (!ret) if (!ret)
{ {
vel = FindDistance2D(pp->xvect>>8, pp->yvect>>8); vel = FindDistance2D(pp->vect.X>>8, pp->yvect>>8);
if (vel > 13000) if (vel > 13000)
{ {
@ -2643,7 +2643,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
if (vel > 12000) if (vel > 12000)
{ {
pp->xvect = pp->yvect = pp->oxvect = pp->oyvect = 0; pp->vect.X = pp->yvect = pp->oxvect = pp->oyvect = 0;
} }
} }
} }
@ -2664,7 +2664,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
{ {
vec3_t clippos = { pp->pos.X, pp->pos.Y, z }; vec3_t clippos = { pp->pos.X, pp->pos.Y, z };
Collision coll; Collision coll;
clipmove(clippos, &pp->cursector, pp->xvect, pp->yvect, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, actor->user.coll); clipmove(clippos, &pp->cursector, pp->vect.X, pp->yvect, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, actor->user.coll);
pp->pos.vec2 = clippos.vec2; pp->pos.vec2 = clippos.vec2;
} }
@ -2678,12 +2678,12 @@ void DoPlayerMoveVehicle(PLAYERp pp)
{ {
int vel; int vel;
vel = FindDistance2D(pp->xvect>>8, pp->yvect>>8); vel = FindDistance2D(pp->vect.X>>8, pp->yvect>>8);
if (vel > 13000) if (vel > 13000)
{ {
VehicleMoveHit(actor); VehicleMoveHit(actor);
pp->slide_xvect = -pp->xvect<<1; pp->slide_xvect = -pp->vect.X<<1;
pp->slide_yvect = -pp->yvect<<1; pp->slide_yvect = -pp->yvect<<1;
if (!(sop->flags & SOBJ_NO_QUAKE)) if (!(sop->flags & SOBJ_NO_QUAKE))
SetPlayerQuake(pp); SetPlayerQuake(pp);
@ -2691,7 +2691,7 @@ void DoPlayerMoveVehicle(PLAYERp pp)
if (vel > 12000) if (vel > 12000)
{ {
pp->xvect = pp->yvect = pp->oxvect = pp->oyvect = 0; pp->vect.X = pp->yvect = pp->oxvect = pp->oyvect = 0;
} }
} }
} }
@ -3141,15 +3141,15 @@ void DoPlayerClimb(PLAYERp pp)
if (Prediction) if (Prediction)
return; return;
pp->xvect += ((pp->input.fvel*synctics*2)<<6); pp->vect.X += ((pp->input.fvel*synctics*2)<<6);
pp->yvect += ((pp->input.svel*synctics*2)<<6); pp->yvect += ((pp->input.svel*synctics*2)<<6);
pp->xvect = MulScale(pp->xvect, PLAYER_CLIMB_FRICTION, 16); pp->vect.X = MulScale(pp->vect.X, PLAYER_CLIMB_FRICTION, 16);
pp->yvect = MulScale(pp->yvect, PLAYER_CLIMB_FRICTION, 16); pp->yvect = MulScale(pp->yvect, PLAYER_CLIMB_FRICTION, 16);
if (labs(pp->xvect) < 12800 && labs(pp->yvect) < 12800) if (labs(pp->vect.X) < 12800 && labs(pp->yvect) < 12800)
pp->xvect = pp->yvect = 0; pp->vect.X = pp->yvect = 0;
climbvel = FindDistance2D(pp->xvect, pp->yvect)>>9; climbvel = FindDistance2D(pp->vect.X, pp->yvect)>>9;
dot = DOT_PRODUCT_2D(pp->xvect, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin()); dot = DOT_PRODUCT_2D(pp->vect.X, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin());
if (dot < 0) if (dot < 0)
climbvel = -climbvel; climbvel = -climbvel;
@ -3670,7 +3670,7 @@ bool PlayerOnLadder(PLAYERp pp)
neartag(pp->pos, pp->cursector, pp->angle.ang.asbuild(), near, 1024 + 768, NTAG_SEARCH_LO_HI); neartag(pp->pos, pp->cursector, pp->angle.ang.asbuild(), near, 1024 + 768, NTAG_SEARCH_LO_HI);
dir = DOT_PRODUCT_2D(pp->xvect, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin()); dir = DOT_PRODUCT_2D(pp->vect.X, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin());
if (dir < 0) if (dir < 0)
return false; return false;
@ -5053,7 +5053,7 @@ void PlayerToRemote(PLAYERp pp)
pp->remote.posy = pp->pos.Y; pp->remote.posy = pp->pos.Y;
pp->remote.posz = pp->pos.Z; pp->remote.posz = pp->pos.Z;
pp->remote.xvect = pp->xvect; pp->remote.xvect = pp->vect.X;
pp->remote.yvect = pp->yvect; pp->remote.yvect = pp->yvect;
pp->remote.oxvect = pp->oxvect; pp->remote.oxvect = pp->oxvect;
pp->remote.oyvect = pp->oyvect; pp->remote.oyvect = pp->oyvect;
@ -5070,7 +5070,7 @@ void RemoteToPlayer(PLAYERp pp)
pp->pos.Y = pp->remote.posy; pp->pos.Y = pp->remote.posy;
pp->pos.Z = pp->remote.posz; pp->pos.Z = pp->remote.posz;
pp->xvect = pp->remote.xvect; pp->vect.X = pp->remote.xvect;
pp->yvect = pp->remote.yvect; pp->yvect = pp->remote.yvect;
pp->oxvect = pp->remote.oxvect; pp->oxvect = pp->remote.oxvect;
pp->oyvect = pp->remote.oyvect; pp->oyvect = pp->remote.oyvect;
@ -5088,7 +5088,7 @@ void PlayerRemoteReset(PLAYERp pp, sectortype* sect)
pp->pos.Y = rsp->spr.pos.Y; pp->pos.Y = rsp->spr.pos.Y;
pp->pos.Z = sect->floorz - PLAYER_HEIGHT; pp->pos.Z = sect->floorz - PLAYER_HEIGHT;
pp->xvect = pp->yvect = pp->oxvect = pp->oyvect = pp->slide_xvect = pp->slide_yvect = 0; pp->vect.X = pp->yvect = pp->oxvect = pp->oyvect = pp->slide_xvect = pp->slide_yvect = 0;
UpdatePlayerSprite(pp); UpdatePlayerSprite(pp);
} }
@ -7086,7 +7086,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, circle_camera_dist)
//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siy) //DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siy)
//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siz) //DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siz)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siang) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siang)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, xvect) //DEFINE_FIELD_X(SWPlayer, PLAYERstruct, xvect)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, yvect) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, yvect)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oxvect) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oxvect)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oyvect) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oyvect)

View file

@ -465,7 +465,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
("siy", w.si.Y) ("siy", w.si.Y)
("siz", w.si.Z) ("siz", w.si.Z)
("siang", w.siang) ("siang", w.siang)
("xvect", w.xvect) ("xvect", w.vect.X)
("yvect", w.yvect) ("yvect", w.yvect)
("friction", w.friction) ("friction", w.friction)
("slide_xvect", w.slide_xvect) ("slide_xvect", w.slide_xvect)
@ -583,7 +583,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
w.opos.Y = w.pos.X; w.opos.Y = w.pos.X;
w.opos.Z = w.pos.X; w.opos.Z = w.pos.X;
w.oz_speed = w.z_speed; w.oz_speed = w.z_speed;
w.oxvect = w.xvect; w.oxvect = w.vect.X;
w.oyvect = w.yvect; w.oyvect = w.yvect;
w.obob_z = w.bob_z; w.obob_z = w.bob_z;
w.input = {}; w.input = {};

View file

@ -16448,7 +16448,7 @@ int InitGrenade(PLAYERp pp)
if (!auto_aim) if (!auto_aim)
{ {
// adjust xvel according to player velocity // adjust xvel according to player velocity
actorNew->user.xchange += pp->xvect>>14; actorNew->user.xchange += pp->vect.X>>14;
actorNew->user.ychange += pp->yvect>>14; actorNew->user.ychange += pp->yvect>>14;
} }
@ -16560,13 +16560,13 @@ int InitMine(PLAYERp pp)
actorNew->user.xchange = MOVEx(actorNew->spr.xvel, actorNew->spr.ang); actorNew->user.xchange = MOVEx(actorNew->spr.xvel, actorNew->spr.ang);
actorNew->user.ychange = MOVEy(actorNew->spr.xvel, actorNew->spr.ang); actorNew->user.ychange = MOVEy(actorNew->spr.xvel, actorNew->spr.ang);
dot = DOT_PRODUCT_2D(pp->xvect, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin()); dot = DOT_PRODUCT_2D(pp->vect.X, pp->yvect, pp->angle.ang.bcos(), pp->angle.ang.bsin());
// don't adjust for strafing // don't adjust for strafing
if (labs(dot) > 10000) if (labs(dot) > 10000)
{ {
// adjust xvel according to player velocity // adjust xvel according to player velocity
actorNew->user.xchange += pp->xvect>>13; actorNew->user.xchange += pp->vect.X>>13;
actorNew->user.ychange += pp->yvect>>13; actorNew->user.ychange += pp->yvect>>13;
} }

View file

@ -196,7 +196,7 @@ struct SWPlayer native
native int circle_camera_dist; native int circle_camera_dist;
native int16 siang; native int16 siang;
native int xvect, yvect; native int yvect;
native int oxvect, oyvect; native int oxvect, oyvect;
native int friction; native int friction;
native int slide_xvect, slide_yvect; native int slide_xvect, slide_yvect;