From 6c5010835c4cca035525b1814db5d4519f42d6b7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 13 Oct 2022 00:16:25 +0200 Subject: [PATCH] - wrapped most of _ovect --- source/games/sw/src/player.cpp | 22 ++++++++++------------ source/games/sw/src/save.cpp | 6 ++---- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 01499ec06..dd3176ebd 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1959,8 +1959,7 @@ void DoPlayerMove(PLAYER* pp) DoPlayerSlide(pp); - pp->_ovect.X = pp->int_vect().X; - pp->_ovect.Y = pp->int_vect().Y; + pp->_ovect = pp->_vect; pp->add_int_vect_x(((pp->input.fvel*synctics*2)<<6)); pp->add_int_vect_y(((pp->input.svel*synctics*2)<<6)); @@ -1977,14 +1976,14 @@ void DoPlayerMove(PLAYER* pp) if (pp->Flags & (PF_FLYING)) { // do a bit of weighted averaging - pp->set_int_vect_x((pp->int_vect().X + (pp->_ovect.X*1))/2); - pp->set_int_vect_y((pp->int_vect().Y + (pp->_ovect.Y*1))/2); + pp->set_int_vect_x((pp->int_vect().X + (pp->int_ovect().X*1))/2); + pp->set_int_vect_y((pp->int_vect().Y + (pp->int_ovect().Y*1))/2); } else if (pp->Flags & (PF_DIVING)) { // do a bit of weighted averaging - pp->set_int_vect_x((pp->int_vect().X + (pp->_ovect.X*2))/3); - pp->set_int_vect_y((pp->int_vect().Y + (pp->_ovect.Y*2))/3); + pp->set_int_vect_x((pp->int_vect().X + (pp->int_ovect().X*2))/3); + pp->set_int_vect_y((pp->int_vect().Y + (pp->int_ovect().Y*2))/3); } if (abs(pp->int_vect().X) < 12800 && abs(pp->int_vect().Y) < 12800) @@ -2478,8 +2477,7 @@ void DoPlayerMoveVehicle(PLAYER* pp) else pp->Flags |= (PF_PLAYER_MOVED); - pp->_ovect.X = pp->int_vect().X; - pp->_ovect.Y = pp->int_vect().Y; + pp->_ovect = pp->_vect; if (sop->drive_speed) { @@ -2487,8 +2485,8 @@ void DoPlayerMoveVehicle(PLAYER* pp) pp->set_int_vect_y(MulScale(pp->input.svel, sop->drive_speed, 6)); // does sliding/momentum - pp->set_int_vect_x((pp->int_vect().X + (pp->_ovect.X*(sop->drive_slide-1)))/sop->drive_slide); - pp->set_int_vect_y((pp->int_vect().Y + (pp->_ovect.Y*(sop->drive_slide-1)))/sop->drive_slide); + pp->set_int_vect_x((pp->int_vect().X + (pp->int_ovect().X*(sop->drive_slide-1)))/sop->drive_slide); + pp->set_int_vect_y((pp->int_vect().Y + (pp->int_ovect().Y*(sop->drive_slide-1)))/sop->drive_slide); } else { @@ -2498,8 +2496,8 @@ void DoPlayerMoveVehicle(PLAYER* pp) pp->set_int_vect_x(MulScale(pp->int_vect().X, TANK_FRICTION, 16)); pp->set_int_vect_y(MulScale(pp->int_vect().Y, TANK_FRICTION, 16)); - pp->set_int_vect_x((pp->int_vect().X + (pp->_ovect.X*1))/2); - pp->set_int_vect_y((pp->int_vect().Y + (pp->_ovect.Y*1))/2); + pp->set_int_vect_x((pp->int_vect().X + (pp->int_ovect().X*1))/2); + pp->set_int_vect_y((pp->int_vect().Y + (pp->int_ovect().Y*1))/2); } if (abs(pp->int_vect().X) < 12800 && abs(pp->int_vect().Y) < 12800) diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 8f89a5344..8eff4b19c 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -406,8 +406,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, REMOTE_CONTROL& w, } if (arc.isReading()) { - w._ovect.Y = w.int_vect().X; - w._ovect.Y = w.int_vect().Y; + w._ovect = w.int_vect(); } return arc; } @@ -576,8 +575,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER* if (arc.isReading()) { w.opos = w.pos; - w._ovect.X = w.int_vect().X; - w._ovect.Y = w.int_vect().Y; + w._ovect = w.int_vect(); w.obob_z = w.bob_z; w.input = {}; w.lastinput = {};