From 21025ea18fda61e5058fa0c7a8f7d06822fcdf55 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 20 Oct 2019 17:55:24 +0000 Subject: [PATCH] Prefer assignment of .vec2 union inside vec3_t instead of explicitly assigning .x and .y members git-svn-id: https://svn.eduke32.com/eduke32@8242 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 15 +++------------ source/duke3d/src/player.cpp | 21 +++++++-------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index b6d803a3a..d63eb3045 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -6291,10 +6291,7 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 pPlayer->pos.y += x; if (g_netServer || numplayers > 1) - { - pPlayer->opos.x = pPlayer->pos.x; - pPlayer->opos.y = pPlayer->pos.y; - } + pPlayer->opos.vec2 = pPlayer->pos.vec2; pPlayer->bobpos.x += l; pPlayer->bobpos.y += x; @@ -7549,16 +7546,10 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3 pPlayer->bobpos.y += x; if (g_netServer || numplayers > 1) - { - pPlayer->opos.x = pPlayer->pos.x; - pPlayer->opos.y = pPlayer->pos.y; - } + pPlayer->opos.vec2 = pPlayer->pos.vec2; if (sprite[pPlayer->i].extra <= 0) - { - sprite[pPlayer->i].x = pPlayer->pos.x; - sprite[pPlayer->i].y = pPlayer->pos.y; - } + sprite[pPlayer->i].pos.vec2 = pPlayer->pos.vec2; } } diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index f1dc0f765..f9ed2a221 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -4911,21 +4911,14 @@ void P_ProcessInput(int playerNum) pPlayer->bobcounter += sprite[pPlayer->i].xvel>>1; if (ud.noclip == 0 && ((uint16_t)pPlayer->cursectnum >= MAXSECTORS || sector[pPlayer->cursectnum].floorpicnum == MIRROR)) - { - pPlayer->pos.x = pPlayer->opos.x; - pPlayer->pos.y = pPlayer->opos.y; - } + pPlayer->pos.vec2 = pPlayer->opos.vec2; else - { - pPlayer->opos.x = pPlayer->pos.x; - pPlayer->opos.y = pPlayer->pos.y; - } + pPlayer->opos.vec2 = pPlayer->pos.vec2; - pPlayer->bobpos.x = pPlayer->pos.x; - pPlayer->bobpos.y = pPlayer->pos.y; - pPlayer->opos.z = pPlayer->pos.z; - pPlayer->opyoff = pPlayer->pyoff; - pPlayer->oq16ang = pPlayer->q16ang; + pPlayer->bobpos = pPlayer->pos.vec2; + pPlayer->opos.z = pPlayer->pos.z; + pPlayer->opyoff = pPlayer->pyoff; + pPlayer->oq16ang = pPlayer->q16ang; if (pPlayer->one_eighty_count < 0) { @@ -5430,7 +5423,7 @@ HORIZONLY:; pPlayer->on_warping_sector = 0; - bool mashedPotato = 0; + bool mashedPotato = false; if (pPlayer->cursectnum >= 0 && ud.noclip == 0) {