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