From 02dfa10d279696b7716d8ec1e2775dcb587be9be Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 30 Jul 2020 08:49:01 +1000 Subject: [PATCH] - remove redundant if statement left over from 2260c2353dbdbf403dd466e8952bb0cbebc2f7b6. --- source/games/duke/src/funct.h | 2 +- source/games/duke/src/player.cpp | 4 ++-- source/games/duke/src/player_d.cpp | 9 +-------- source/games/duke/src/player_r.cpp | 9 +-------- 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index fc05d16eb..c5040e802 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -244,7 +244,7 @@ void dointerpolations(int smoothratio); int* animateptr(int i); void updateviewport(void); -void backuppos(player_struct* p, bool clipping = true); +void backuppos(player_struct* p, bool noclipping = false); void backuplook(player_struct* p); void backupview(player_struct* p); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index b2008d711..7c868c25e 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -850,9 +850,9 @@ void applylook(int snum, double factor) // //--------------------------------------------------------------------------- -void backuppos(player_struct* p, bool clipping) +void backuppos(player_struct* p, bool noclipping) { - if (clipping) + if (!noclipping) { p->oposx = p->posx; p->oposy = p->posy; diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 4196490b5..9e7b61e90 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -2746,14 +2746,7 @@ void processinput_d(int snum) ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy)); if (p->on_ground) p->bobcounter += sprite[p->i].xvel >> 1; - if (ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS)) - { - backuppos(p, false); - } - else - { - backuppos(p); - } + backuppos(p, ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS)); // Shrinking code diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index fa2d8247a..d3f8abbd6 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3641,14 +3641,7 @@ void processinput_r(int snum) ksqrt((p->posx - p->bobposx) * (p->posx - p->bobposx) + (p->posy - p->bobposy) * (p->posy - p->bobposy)); if (p->on_ground) p->bobcounter += sprite[p->i].xvel >> 1; - if (ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS)) - { - backuppos(p, false); - } - else - { - backuppos(p); - } + backuppos(p, ud.clipping == 0 && (sector[p->cursectnum].floorpicnum == MIRROR || p->cursectnum < 0 || p->cursectnum >= MAXSECTORS)); // Shrinking code