From 2d4b679fcb9dfbb889ff4524896e30654cd0c12a Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 8 Jan 2008 03:21:01 +0000 Subject: [PATCH] - Fixed: P_BounceWall() cannot assume that BlockingLine is the line the actor should bounce off of. Since the order lines in a blockmap cell are checked for collision is essentially undefined, there could be another line closer to the actor that it should bounce off of instead. SVN r678 (trunk) --- docs/rh-log.txt | 4 ++ src/p_map.cpp | 87 ++++++++++++++++++++------------------------ wadsrc/wadsrc.vcproj | 46 ++++++++++++----------- 3 files changed, 69 insertions(+), 68 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 1e8946c8b..8d0abfdfb 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ January 7, 2008 +- Fixed: P_BounceWall() cannot assume that BlockingLine is the line the actor + should bounce off of. Since the order lines in a blockmap cell are checked + for collision is essentially undefined, there could be another line closer to + the actor that it should bounce off of instead. - Fixed: Thing_SetTranslation still used a 16-bit word to hold the translation. - Bumped the maximum resolution up to 2560x1600. - Fixed: DCanvas::DrawTexture() only expanded virtual screen sizes for widescreen diff --git a/src/p_map.cpp b/src/p_map.cpp index 054e0ca84..9503e2e3c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2423,57 +2423,50 @@ bool P_BounceWall (AActor *mo) return false; } - if (BlockingLine != NULL) - { - line = BlockingLine; - } - else - { - slidemo = mo; + slidemo = mo; // // trace along the three leading corners // - if (mo->momx > 0) - { - leadx = mo->x+mo->radius; - } - else - { - leadx = mo->x-mo->radius; - } - if (mo->momy > 0) - { - leady = mo->y+mo->radius; - } - else - { - leady = mo->y-mo->radius; - } - bestslidefrac = FRACUNIT+1; - if (P_PathTraverse(leadx, leady, leadx+mo->momx, leady+mo->momy, - PT_ADDLINES, PTR_BounceTraverse)) - { // Could not find a wall, so bounce off the floor/ceiling instead. - fixed_t floordist = mo->z - mo->floorz; - fixed_t ceildist = mo->ceilingz - mo->z; - if (floordist <= ceildist) - { - mo->FloorBounceMissile (mo->Sector->floorplane); - return true; - } - else - { - mo->FloorBounceMissile (mo->Sector->ceilingplane); - return true; - } - /* - else - { - return (mo->flags2 & MF2_BOUNCE2) != 0; - } - */ - } - line = bestslideline; + if (mo->momx > 0) + { + leadx = mo->x+mo->radius; } + else + { + leadx = mo->x-mo->radius; + } + if (mo->momy > 0) + { + leady = mo->y+mo->radius; + } + else + { + leady = mo->y-mo->radius; + } + bestslidefrac = FRACUNIT+1; + if (P_PathTraverse(leadx, leady, leadx+mo->momx, leady+mo->momy, + PT_ADDLINES, PTR_BounceTraverse)) + { // Could not find a wall, so bounce off the floor/ceiling instead. + fixed_t floordist = mo->z - mo->floorz; + fixed_t ceildist = mo->ceilingz - mo->z; + if (floordist <= ceildist) + { + mo->FloorBounceMissile (mo->Sector->floorplane); + return true; + } + else + { + mo->FloorBounceMissile (mo->Sector->ceilingplane); + return true; + } + /* + else + { + return (mo->flags2 & MF2_BOUNCE2) != 0; + } + */ + } + line = bestslideline; if (line->special == Line_Horizon) { diff --git a/wadsrc/wadsrc.vcproj b/wadsrc/wadsrc.vcproj index a07c39c5a..a95ef1786 100644 --- a/wadsrc/wadsrc.vcproj +++ b/wadsrc/wadsrc.vcproj @@ -39,27 +39,6 @@ CompileAsManaged="" /> - - - + + + + +