diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 07920a147..d181b1397 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1303,8 +1303,7 @@ int PlayerInitChemBomb(PLAYER* pp) UpdateChange(actorNew, 0.5); // adjust xvel according to player velocity - actorNew->user.change.X += FixedToFloat<18>(pp->int_vect().X); - actorNew->user.change.Y += FixedToFloat<18>(pp->int_vect().Y); + actorNew->user.change += pp->vect; // Smoke will come out for this many seconds actorNew->user.WaitTics = CHEMTICS; @@ -1659,8 +1658,7 @@ int PlayerInitCaltrops(PLAYER* pp) UpdateChange(actorNew, 0.5); // adjust xvel according to player velocity - actorNew->user.change.X += FixedToFloat<18>(pp->int_vect().X); - actorNew->user.change.Y += FixedToFloat<18>(pp->int_vect().Y); + actorNew->user.change += pp->vect; SetupSpriteForBreak(actorNew); // Put Caltrops in the break queue return 0; diff --git a/source/games/sw/src/mclip.cpp b/source/games/sw/src/mclip.cpp index 7f4004d98..a75e16276 100644 --- a/source/games/sw/src/mclip.cpp +++ b/source/games/sw/src/mclip.cpp @@ -98,7 +98,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist) pos[i].Z = zz; // move the box - 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); + clipmove(pos[i], &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), (int)sop->clipbox_dist[i], Z(4), int(floordist * zworldtoint), CLIPMASK_PLAYER, coll); // save the dist moved dist = (pos[i].XY() - opos[i].XY()).Length(); @@ -205,7 +205,7 @@ int RectClipMove(PLAYER* pp, DVector2* qpos) int i; DVector2 xy[4]; int point_num; - DVector2 pvect((pp->int_vect().X >> 14) * inttoworld, (pp->int_vect().Y >> 14) * inttoworld); + DVector2 pvect = pp->vect; for (i = 0; i < 4; i++) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index e35e244e0..01295a53d 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1872,7 +1872,7 @@ void DoPlayerSlide(PLAYER* pp) return; } Collision coll; - clipmove(pp->pos, &pp->cursector, pp->int_slide_vect().X, pp->int_slide_vect().Y, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll); + clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->slide_vect.X), FloatToFixed<18>(pp->slide_vect.Y), ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll); PlayerCheckValidMove(pp); push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER); @@ -1999,7 +1999,7 @@ void DoPlayerMove(PLAYER* pp) { pp->opos.XY() = pp->pos.XY(); } - pp->add_int_ppos_XY({ pp->int_vect().X >> 14, pp->int_vect().Y >> 14 }); + pp->pos += pp->vect; updatesector(pp->pos, §); if (sect != nullptr) pp->cursector = sect; @@ -2029,7 +2029,7 @@ void DoPlayerMove(PLAYER* pp) actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK); Collision coll; updatesector(pp->int_ppos().X, pp->int_ppos().Y, &pp->cursector); - 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); + clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), ((int)actor->spr.clipdist<<2), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll); actor->spr.cstat = save_cstat; PlayerCheckValidMove(pp); @@ -2310,7 +2310,7 @@ void DriveCrush(PLAYER* pp, DVector2* quad) return; // not moving - don't crush - if ((pp->int_vect().X|pp->int_vect().Y) == 0 && pp->input.avel == 0) + if ((pp->vect.isZero()) == 0 && pp->input.avel == 0) return; // main sector @@ -2603,7 +2603,7 @@ void DoPlayerMoveVehicle(PLAYER* pp) if (pp->sop->clipdist) { Collision 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); + clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), (int)pp->sop->clipdist, Z(4), floor_dist, CLIPMASK_PLAYER, actor->user.coll); } else { diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index fde1c7aa7..c4e002be7 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -15877,8 +15877,7 @@ int InitGrenade(PLAYER* pp) if (!auto_aim) { // adjust xvel according to player velocity - actorNew->user.change.X += FixedToFloat<18>(pp->int_vect().X); - actorNew->user.change.Y += FixedToFloat<18>(pp->int_vect().Y); + actorNew->user.change += pp->vect; } actorNew->user.Counter2 = true; // Phosphorus Grenade @@ -15980,8 +15979,7 @@ int InitMine(PLAYER* pp) if (abs(dot) > 10000) { // adjust xvel according to player velocity - actorNew->user.change.X += FixedToFloat<18>(2 * pp->int_vect().X); - actorNew->user.change.Y += FixedToFloat<18>(2 * pp->int_vect().Y); + actorNew->user.change += 2 * pp->vect; } return 0;