mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 04:24:39 +00:00
- use access functions for reading _vect.
This commit is contained in:
parent
7f3c5ae18d
commit
4547372d4d
7 changed files with 71 additions and 63 deletions
|
@ -584,6 +584,10 @@ struct REMOTE_CONTROL
|
||||||
vec2_t _vect, _ovect, _slide_vect;
|
vec2_t _vect, _ovect, _slide_vect;
|
||||||
DVector3 pos;
|
DVector3 pos;
|
||||||
SECTOR_OBJECT* sop_control;
|
SECTOR_OBJECT* sop_control;
|
||||||
|
|
||||||
|
vec2_t int_vect() const { return _vect; }
|
||||||
|
vec2_t int_ovect() const { return _ovect; }
|
||||||
|
vec2_t int_slide_vect() const { return _slide_vect; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PLAYER
|
struct PLAYER
|
||||||
|
@ -630,6 +634,10 @@ struct PLAYER
|
||||||
DAngle siang;
|
DAngle siang;
|
||||||
|
|
||||||
vec2_t _vect, _ovect, _slide_vect; // these need floatification, but must be done together. vect is in 14.18 format!
|
vec2_t _vect, _ovect, _slide_vect; // these need floatification, but must be done together. vect is in 14.18 format!
|
||||||
|
vec2_t int_vect() const { return _vect; }
|
||||||
|
vec2_t int_ovect() const { return _ovect; }
|
||||||
|
vec2_t int_slide_vect() const { return _slide_vect; }
|
||||||
|
|
||||||
int friction;
|
int friction;
|
||||||
int16_t slide_ang; // todo: floatify
|
int16_t slide_ang; // todo: floatify
|
||||||
int slide_dec;
|
int slide_dec;
|
||||||
|
@ -2240,7 +2248,7 @@ inline bool SpriteInUnderwaterArea(DSWActor* a)
|
||||||
// just determine if the player is moving
|
// just determine if the player is moving
|
||||||
inline bool PLAYER_MOVING(PLAYER* pp)
|
inline bool PLAYER_MOVING(PLAYER* pp)
|
||||||
{
|
{
|
||||||
return (pp->_vect.X | pp->_vect.Y);
|
return (pp->int_vect().X | pp->int_vect().Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void PlaySound(int num, DSWActor* actor, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
|
inline void PlaySound(int num, DSWActor* actor, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
|
||||||
|
|
|
@ -1303,8 +1303,8 @@ int PlayerInitChemBomb(PLAYER* pp)
|
||||||
UpdateChange(actorNew, 0.5);
|
UpdateChange(actorNew, 0.5);
|
||||||
|
|
||||||
// adjust xvel according to player velocity
|
// adjust xvel according to player velocity
|
||||||
actorNew->user.change.X += FixedToFloat<18>(pp->_vect.X);
|
actorNew->user.change.X += FixedToFloat<18>(pp->int_vect().X);
|
||||||
actorNew->user.change.Y += FixedToFloat<18>(pp->_vect.Y);
|
actorNew->user.change.Y += FixedToFloat<18>(pp->int_vect().Y);
|
||||||
|
|
||||||
// Smoke will come out for this many seconds
|
// Smoke will come out for this many seconds
|
||||||
actorNew->user.WaitTics = CHEMTICS;
|
actorNew->user.WaitTics = CHEMTICS;
|
||||||
|
@ -1659,8 +1659,8 @@ int PlayerInitCaltrops(PLAYER* pp)
|
||||||
UpdateChange(actorNew, 0.5);
|
UpdateChange(actorNew, 0.5);
|
||||||
|
|
||||||
// adjust xvel according to player velocity
|
// adjust xvel according to player velocity
|
||||||
actorNew->user.change.X += FixedToFloat<18>(pp->_vect.X);
|
actorNew->user.change.X += FixedToFloat<18>(pp->int_vect().X);
|
||||||
actorNew->user.change.Y += FixedToFloat<18>(pp->_vect.Y);
|
actorNew->user.change.Y += FixedToFloat<18>(pp->int_vect().Y);
|
||||||
|
|
||||||
SetupSpriteForBreak(actorNew); // Put Caltrops in the break queue
|
SetupSpriteForBreak(actorNew); // Put Caltrops in the break queue
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -98,7 +98,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
|
||||||
pos[i].Z = zz;
|
pos[i].Z = zz;
|
||||||
|
|
||||||
// move the box
|
// move the box
|
||||||
clipmove(pos[i], &pp->cursector, pp->_vect.X, pp->_vect.Y, (int)sop->clipbox_dist[i], Z(4), int(floordist * zworldtoint), CLIPMASK_PLAYER, coll);
|
clipmove(pos[i], &pp->cursector, pp->int_vect().X, pp->int_vect().Y, (int)sop->clipbox_dist[i], Z(4), int(floordist * zworldtoint), CLIPMASK_PLAYER, coll);
|
||||||
|
|
||||||
// save the dist moved
|
// save the dist moved
|
||||||
dist = (pos[i].XY() - opos[i].XY()).Length();
|
dist = (pos[i].XY() - opos[i].XY()).Length();
|
||||||
|
@ -205,7 +205,7 @@ int RectClipMove(PLAYER* pp, DVector2* qpos)
|
||||||
int i;
|
int i;
|
||||||
DVector2 xy[4];
|
DVector2 xy[4];
|
||||||
int point_num;
|
int point_num;
|
||||||
DVector2 pvect((pp->_vect.X >> 14) * inttoworld, (pp->_vect.Y >> 14) * inttoworld);
|
DVector2 pvect((pp->int_vect().X >> 14) * inttoworld, (pp->int_vect().Y >> 14) * inttoworld);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6307,7 +6307,7 @@ void pWeaponBob(PANEL_SPRITE* psp, short condition)
|
||||||
{
|
{
|
||||||
double xdiff = 0, ydiff = 0;
|
double xdiff = 0, ydiff = 0;
|
||||||
|
|
||||||
double bobvel = fFindDistance2D(psp->PlayerP->_vect.X, psp->PlayerP->_vect.Y) * (1. / 32768.);
|
double bobvel = fFindDistance2D(psp->PlayerP->int_vect().X, psp->PlayerP->int_vect().Y) * (1. / 32768.);
|
||||||
bobvel = bobvel + (bobvel * (1. / 4.));
|
bobvel = bobvel + (bobvel * (1. / 4.));
|
||||||
bobvel = min(bobvel, 128.);
|
bobvel = min(bobvel, 128.);
|
||||||
|
|
||||||
|
|
|
@ -1959,8 +1959,8 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
|
|
||||||
DoPlayerSlide(pp);
|
DoPlayerSlide(pp);
|
||||||
|
|
||||||
pp->_ovect.X = pp->_vect.X;
|
pp->_ovect.X = pp->int_vect().X;
|
||||||
pp->_ovect.Y = pp->_vect.Y;
|
pp->_ovect.Y = pp->int_vect().Y;
|
||||||
|
|
||||||
pp->_vect.X += ((pp->input.fvel*synctics*2)<<6);
|
pp->_vect.X += ((pp->input.fvel*synctics*2)<<6);
|
||||||
pp->_vect.Y += ((pp->input.svel*synctics*2)<<6);
|
pp->_vect.Y += ((pp->input.svel*synctics*2)<<6);
|
||||||
|
@ -1971,26 +1971,26 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
friction -= pp->WadeDepth * 100;
|
friction -= pp->WadeDepth * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
pp->_vect.X = MulScale(pp->_vect.X, friction, 16);
|
pp->_vect.X = MulScale(pp->int_vect().X, friction, 16);
|
||||||
pp->_vect.Y = MulScale(pp->_vect.Y, friction, 16);
|
pp->_vect.Y = MulScale(pp->int_vect().Y, 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->_vect.X = (pp->_vect.X + (pp->_ovect.X*1))/2;
|
pp->_vect .X = (pp->int_vect().X + (pp->_ovect.X*1))/2;
|
||||||
pp->_vect.Y = (pp->_vect.Y + (pp->_ovect.Y*1))/2;
|
pp->_vect .Y = (pp->int_vect().Y + (pp->_ovect.Y*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->_vect.X = (pp->_vect.X + (pp->_ovect.X*2))/3;
|
pp->_vect .X = (pp->int_vect().X + (pp->_ovect.X*2))/3;
|
||||||
pp->_vect.Y = (pp->_vect.Y + (pp->_ovect.Y*2))/3;
|
pp->_vect .Y = (pp->int_vect().Y + (pp->_ovect.Y*2))/3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abs(pp->_vect.X) < 12800 && abs(pp->_vect.Y) < 12800)
|
if (abs(pp->int_vect().X) < 12800 && abs(pp->int_vect().Y) < 12800)
|
||||||
pp->_vect .X = pp->_vect .Y = 0;
|
pp->_vect .X = pp->_vect .Y = 0;
|
||||||
|
|
||||||
actor->set_int_xvel(FindDistance2D(pp->_vect.X,pp->_vect.Y)>>14);
|
actor->set_int_xvel(FindDistance2D(pp->int_vect().X,pp->int_vect().Y)>>14);
|
||||||
|
|
||||||
if (pp->Flags & (PF_CLIP_CHEAT))
|
if (pp->Flags & (PF_CLIP_CHEAT))
|
||||||
{
|
{
|
||||||
|
@ -1999,7 +1999,7 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
{
|
{
|
||||||
pp->opos.XY() = pp->pos.XY();
|
pp->opos.XY() = pp->pos.XY();
|
||||||
}
|
}
|
||||||
pp->add_int_ppos_XY({ pp->_vect.X >> 14, pp->_vect.Y >> 14 });
|
pp->add_int_ppos_XY({ pp->int_vect().X >> 14, pp->int_vect().Y >> 14 });
|
||||||
updatesector(pp->pos, §);
|
updatesector(pp->pos, §);
|
||||||
if (sect != nullptr)
|
if (sect != nullptr)
|
||||||
pp->cursector = sect;
|
pp->cursector = sect;
|
||||||
|
@ -2029,7 +2029,7 @@ void DoPlayerMove(PLAYER* pp)
|
||||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||||
Collision coll;
|
Collision coll;
|
||||||
updatesector(pp->int_ppos().X, pp->int_ppos().Y, &pp->cursector);
|
updatesector(pp->int_ppos().X, pp->int_ppos().Y, &pp->cursector);
|
||||||
clipmove(pp->pos, &pp->cursector, pp->_vect.X, pp->_vect.Y, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
clipmove(pp->pos, &pp->cursector, pp->int_vect().X, pp->int_vect().Y, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||||
|
|
||||||
actor->spr.cstat = save_cstat;
|
actor->spr.cstat = save_cstat;
|
||||||
PlayerCheckValidMove(pp);
|
PlayerCheckValidMove(pp);
|
||||||
|
@ -2200,8 +2200,8 @@ void DoTankTreads(PLAYER* pp)
|
||||||
if (Prediction)
|
if (Prediction)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vel = FindDistance2D(pp->_vect.X>>8, pp->_vect.Y>>8);
|
vel = FindDistance2D(pp->int_vect().X>>8, pp->int_vect().Y>>8);
|
||||||
dot = DOT_PRODUCT_2D(pp->_vect.X, pp->_vect.Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
dot = DOT_PRODUCT_2D(pp->int_vect().X, pp->int_vect().Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
||||||
if (dot < 0)
|
if (dot < 0)
|
||||||
reverse = true;
|
reverse = true;
|
||||||
|
|
||||||
|
@ -2310,7 +2310,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// not moving - don't crush
|
// not moving - don't crush
|
||||||
if ((pp->_vect.X|pp->_vect.Y) == 0 && pp->input.avel == 0)
|
if ((pp->int_vect().X|pp->int_vect().Y) == 0 && pp->input.avel == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// main sector
|
// main sector
|
||||||
|
@ -2358,10 +2358,10 @@ void DriveCrush(PLAYER* pp, DVector2* quad)
|
||||||
if (actor->int_pos().Z < sop->crush_z)
|
if (actor->int_pos().Z < sop->crush_z)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int32_t const vel = FindDistance2D(pp->_vect.X>>8, pp->_vect.Y>>8);
|
int32_t const vel = FindDistance2D(pp->int_vect().X>>8, pp->int_vect().Y>>8);
|
||||||
if (vel < 9000)
|
if (vel < 9000)
|
||||||
{
|
{
|
||||||
DoActorBeginSlide(actor, VecToAngle(pp->_vect.X, pp->_vect.Y), vel/8 * inttoworld);
|
DoActorBeginSlide(actor, VecToAngle(pp->int_vect().X, pp->int_vect().Y), vel/8 * inttoworld);
|
||||||
if (DoActorSlide(actor))
|
if (DoActorSlide(actor))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2478,8 +2478,8 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
||||||
else
|
else
|
||||||
pp->Flags |= (PF_PLAYER_MOVED);
|
pp->Flags |= (PF_PLAYER_MOVED);
|
||||||
|
|
||||||
pp->_ovect.X = pp->_vect.X;
|
pp->_ovect.X = pp->int_vect().X;
|
||||||
pp->_ovect.Y = pp->_vect.Y;
|
pp->_ovect.Y = pp->int_vect().Y;
|
||||||
|
|
||||||
if (sop->drive_speed)
|
if (sop->drive_speed)
|
||||||
{
|
{
|
||||||
|
@ -2487,22 +2487,22 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
||||||
pp->_vect .Y = MulScale(pp->input.svel, sop->drive_speed, 6);
|
pp->_vect .Y = MulScale(pp->input.svel, sop->drive_speed, 6);
|
||||||
|
|
||||||
// does sliding/momentum
|
// does sliding/momentum
|
||||||
pp->_vect.X = (pp->_vect.X + (pp->_ovect.X*(sop->drive_slide-1)))/sop->drive_slide;
|
pp->_vect .X = (pp->int_vect().X + (pp->_ovect.X*(sop->drive_slide-1)))/sop->drive_slide;
|
||||||
pp->_vect.Y = (pp->_vect.Y + (pp->_ovect.Y*(sop->drive_slide-1)))/sop->drive_slide;
|
pp->_vect .Y = (pp->int_vect().Y + (pp->_ovect.Y*(sop->drive_slide-1)))/sop->drive_slide;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pp->_vect.X += ((pp->input.fvel*synctics*2)<<6);
|
pp->_vect.X += ((pp->input.fvel*synctics*2)<<6);
|
||||||
pp->_vect.Y += ((pp->input.svel*synctics*2)<<6);
|
pp->_vect.Y += ((pp->input.svel*synctics*2)<<6);
|
||||||
|
|
||||||
pp->_vect.X = MulScale(pp->_vect.X, TANK_FRICTION, 16);
|
pp->_vect.X = MulScale(pp->int_vect().X, TANK_FRICTION, 16);
|
||||||
pp->_vect.Y = MulScale(pp->_vect.Y, TANK_FRICTION, 16);
|
pp->_vect.Y = MulScale(pp->int_vect().Y, TANK_FRICTION, 16);
|
||||||
|
|
||||||
pp->_vect.X = (pp->_vect.X + (pp->_ovect.X*1))/2;
|
pp->_vect .X = (pp->int_vect().X + (pp->_ovect.X*1))/2;
|
||||||
pp->_vect.Y = (pp->_vect.Y + (pp->_ovect.Y*1))/2;
|
pp->_vect .Y = (pp->int_vect().Y + (pp->_ovect.Y*1))/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abs(pp->_vect.X) < 12800 && abs(pp->_vect.Y) < 12800)
|
if (abs(pp->int_vect().X) < 12800 && abs(pp->int_vect().Y) < 12800)
|
||||||
pp->_vect .X = pp->_vect .Y = 0;
|
pp->_vect .X = pp->_vect .Y = 0;
|
||||||
|
|
||||||
pp->lastcursector = pp->cursector;
|
pp->lastcursector = pp->cursector;
|
||||||
|
@ -2553,7 +2553,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
vel = FindDistance2D(pp->_vect.X>>8, pp->_vect.Y>>8);
|
vel = FindDistance2D(pp->int_vect().X>>8, pp->int_vect().Y>>8);
|
||||||
|
|
||||||
if (vel > 13000)
|
if (vel > 13000)
|
||||||
{
|
{
|
||||||
|
@ -2603,7 +2603,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
||||||
if (pp->sop->clipdist)
|
if (pp->sop->clipdist)
|
||||||
{
|
{
|
||||||
Collision coll;
|
Collision coll;
|
||||||
clipmove(pp->pos, &pp->cursector, pp->_vect.X, pp->_vect.Y, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, actor->user.coll);
|
clipmove(pp->pos, &pp->cursector, pp->int_vect().X, pp->int_vect().Y, (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, actor->user.coll);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2615,13 +2615,13 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
||||||
{
|
{
|
||||||
int vel;
|
int vel;
|
||||||
|
|
||||||
vel = FindDistance2D(pp->_vect.X>>8, pp->_vect.Y>>8);
|
vel = FindDistance2D(pp->int_vect().X>>8, pp->int_vect().Y>>8);
|
||||||
|
|
||||||
if (vel > 13000)
|
if (vel > 13000)
|
||||||
{
|
{
|
||||||
VehicleMoveHit(actor);
|
VehicleMoveHit(actor);
|
||||||
pp->_slide_vect.X = -pp->_vect.X<<1;
|
pp->_slide_vect.X = -pp->int_vect().X<<1;
|
||||||
pp->_slide_vect.Y = -pp->_vect.Y<<1;
|
pp->_slide_vect.Y = -pp->int_vect().Y<<1;
|
||||||
if (!(sop->flags & SOBJ_NO_QUAKE))
|
if (!(sop->flags & SOBJ_NO_QUAKE))
|
||||||
SetPlayerQuake(pp);
|
SetPlayerQuake(pp);
|
||||||
}
|
}
|
||||||
|
@ -3089,13 +3089,13 @@ void DoPlayerClimb(PLAYER* pp)
|
||||||
|
|
||||||
pp->_vect.X += ((pp->input.fvel*synctics*2)<<6);
|
pp->_vect.X += ((pp->input.fvel*synctics*2)<<6);
|
||||||
pp->_vect.Y += ((pp->input.svel*synctics*2)<<6);
|
pp->_vect.Y += ((pp->input.svel*synctics*2)<<6);
|
||||||
pp->_vect.X = MulScale(pp->_vect.X, PLAYER_CLIMB_FRICTION, 16);
|
pp->_vect.X = MulScale(pp->int_vect().X, PLAYER_CLIMB_FRICTION, 16);
|
||||||
pp->_vect.Y = MulScale(pp->_vect.Y, PLAYER_CLIMB_FRICTION, 16);
|
pp->_vect.Y = MulScale(pp->int_vect().Y, PLAYER_CLIMB_FRICTION, 16);
|
||||||
if (abs(pp->_vect.X) < 12800 && abs(pp->_vect.Y) < 12800)
|
if (abs(pp->int_vect().X) < 12800 && abs(pp->int_vect().Y) < 12800)
|
||||||
pp->_vect .X = pp->_vect .Y = 0;
|
pp->_vect .X = pp->_vect .Y = 0;
|
||||||
|
|
||||||
climbVel = DVector2(pp->_vect.X, pp->_vect.Y).Length() * (1. / 512) * zinttoworld;
|
climbVel = DVector2(pp->int_vect().X, pp->int_vect().Y).Length() * (1. / 512) * zinttoworld;
|
||||||
dot = DOT_PRODUCT_2D(pp->_vect.X, pp->_vect.Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
dot = DOT_PRODUCT_2D(pp->int_vect().X, pp->int_vect().Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
||||||
if (dot < 0)
|
if (dot < 0)
|
||||||
climbVel = -climbVel;
|
climbVel = -climbVel;
|
||||||
|
|
||||||
|
@ -3588,7 +3588,7 @@ bool PlayerOnLadder(PLAYER* pp)
|
||||||
|
|
||||||
neartag(pp->int_ppos(), pp->cursector, pp->angle.ang.Buildang(), near, 1024 + 768, NTAG_SEARCH_LO_HI);
|
neartag(pp->int_ppos(), pp->cursector, pp->angle.ang.Buildang(), near, 1024 + 768, NTAG_SEARCH_LO_HI);
|
||||||
|
|
||||||
dir = DOT_PRODUCT_2D(pp->_vect.X, pp->_vect.Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
dir = DOT_PRODUCT_2D(pp->int_vect().X, pp->int_vect().Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
||||||
|
|
||||||
if (dir < 0)
|
if (dir < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -406,8 +406,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, REMOTE_CONTROL& w,
|
||||||
}
|
}
|
||||||
if (arc.isReading())
|
if (arc.isReading())
|
||||||
{
|
{
|
||||||
w._ovect.Y = w._vect.X;
|
w._ovect.Y = w.int_vect().X;
|
||||||
w._ovect.Y = w._vect.Y;
|
w._ovect.Y = w.int_vect().Y;
|
||||||
}
|
}
|
||||||
return arc;
|
return arc;
|
||||||
}
|
}
|
||||||
|
@ -576,8 +576,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
|
||||||
if (arc.isReading())
|
if (arc.isReading())
|
||||||
{
|
{
|
||||||
w.opos = w.pos;
|
w.opos = w.pos;
|
||||||
w._ovect.X = w._vect.X;
|
w._ovect.X = w.int_vect().X;
|
||||||
w._ovect.Y = w._vect.Y;
|
w._ovect.Y = w.int_vect().Y;
|
||||||
w.obob_z = w.bob_z;
|
w.obob_z = w.bob_z;
|
||||||
w.input = {};
|
w.input = {};
|
||||||
w.lastinput = {};
|
w.lastinput = {};
|
||||||
|
|
|
@ -15877,8 +15877,8 @@ int InitGrenade(PLAYER* pp)
|
||||||
if (!auto_aim)
|
if (!auto_aim)
|
||||||
{
|
{
|
||||||
// adjust xvel according to player velocity
|
// adjust xvel according to player velocity
|
||||||
actorNew->user.change.X += FixedToFloat<18>(pp->_vect.X);
|
actorNew->user.change.X += FixedToFloat<18>(pp->int_vect().X);
|
||||||
actorNew->user.change.Y += FixedToFloat<18>(pp->_vect.Y);
|
actorNew->user.change.Y += FixedToFloat<18>(pp->int_vect().Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
actorNew->user.Counter2 = true; // Phosphorus Grenade
|
actorNew->user.Counter2 = true; // Phosphorus Grenade
|
||||||
|
@ -15974,14 +15974,14 @@ int InitMine(PLAYER* pp)
|
||||||
|
|
||||||
UpdateChange(actorNew, 0.5);
|
UpdateChange(actorNew, 0.5);
|
||||||
|
|
||||||
dot = DOT_PRODUCT_2D(pp->_vect.X, pp->_vect.Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
dot = DOT_PRODUCT_2D(pp->int_vect().X, pp->int_vect().Y, pp->angle.ang.Cos() * (1 << 14), pp->angle.ang.Sin() * (1 << 14));
|
||||||
|
|
||||||
// don't adjust for strafing
|
// don't adjust for strafing
|
||||||
if (abs(dot) > 10000)
|
if (abs(dot) > 10000)
|
||||||
{
|
{
|
||||||
// adjust xvel according to player velocity
|
// adjust xvel according to player velocity
|
||||||
actorNew->user.change.X += FixedToFloat<18>(2 * pp->_vect.X);
|
actorNew->user.change.X += FixedToFloat<18>(2 * pp->int_vect().X);
|
||||||
actorNew->user.change.Y += FixedToFloat<18>(2 * pp->_vect.Y);
|
actorNew->user.change.Y += FixedToFloat<18>(2 * pp->int_vect().Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue