From 64cda33d6d7f433bed8451eaea2630e875d47bdf Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 20:12:42 +0000 Subject: [PATCH 1/2] SMOOTH PAPERCOLLISION TIME!!!!!!!! resolves #273, damn i feel good --- src/p_map.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index c7120535c..3f140e1d5 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3758,6 +3758,33 @@ void P_SlideMove(mobj_t *mo) v2.x = tmhitthing->x + cosradius; v2.y = tmhitthing->y + sinradius; + // Can we box collision our way into smooth movement..? + if (mo->y + mo->radius <= min(v1.y, v2.y)) + { + mo->momy = 0; + P_TryMove(mo, mo->x + mo->momx, min(v1.y, v2.y) - mo->radius, true); + return; + } + else if (mo->y - mo->radius >= max(v1.y, v2.y)) + { + mo->momy = 0; + P_TryMove(mo, mo->x + mo->momx, max(v1.y, v2.y) + mo->radius, true); + return; + } + else if (mo->x + mo->radius <= min(v1.x, v2.x)) + { + mo->momx = 0; + P_TryMove(mo, min(v1.x, v2.x) - mo->radius, mo->y + mo->momy, true); + return; + } + else if (mo->x - mo->radius >= max(v1.x, v2.x)) + { + mo->momx = 0; + P_TryMove(mo, max(v1.x, v2.x) + mo->radius, mo->y + mo->momy, true); + return; + } + + // nope, gotta fuck around with a fake linedef! junk.v1 = &v1; junk.v2 = &v2; junk.dx = 2*cosradius; // v2.x - v1.x; From f54eeb82b7d39ab3e2ff9d435e86774aa6251347 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 25 Nov 2019 22:35:40 +0100 Subject: [PATCH 2/2] -Fix player being able to push up spikes -Minor tweaks to make paper collision slightly more reliable --- src/p_map.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 3f140e1d5..d4c753dfc 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1719,8 +1719,8 @@ static boolean PIT_CheckThing(mobj_t *thing) } } - if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM) && (thing->player)) - ; // springs and gas jets should never be able to step up onto a player + if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM || tmthing->type == MT_SPIKE || tmthing->type == MT_WALLSPIKE) && (thing->player)) + ; // springs, gas jets and springs should never be able to step up onto a player // z checking at last // Treat noclip things as non-solid! else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID @@ -3759,25 +3759,25 @@ void P_SlideMove(mobj_t *mo) v2.y = tmhitthing->y + sinradius; // Can we box collision our way into smooth movement..? - if (mo->y + mo->radius <= min(v1.y, v2.y)) + if (sinradius && mo->y + mo->radius <= min(v1.y, v2.y)) { mo->momy = 0; P_TryMove(mo, mo->x + mo->momx, min(v1.y, v2.y) - mo->radius, true); return; } - else if (mo->y - mo->radius >= max(v1.y, v2.y)) + else if (sinradius && mo->y - mo->radius >= max(v1.y, v2.y)) { mo->momy = 0; P_TryMove(mo, mo->x + mo->momx, max(v1.y, v2.y) + mo->radius, true); return; } - else if (mo->x + mo->radius <= min(v1.x, v2.x)) + else if (cosradius && mo->x + mo->radius <= min(v1.x, v2.x)) { mo->momx = 0; P_TryMove(mo, min(v1.x, v2.x) - mo->radius, mo->y + mo->momy, true); return; } - else if (mo->x - mo->radius >= max(v1.x, v2.x)) + else if (cosradius && mo->x - mo->radius >= max(v1.x, v2.x)) { mo->momx = 0; P_TryMove(mo, max(v1.x, v2.x) + mo->radius, mo->y + mo->momy, true);