From c81fe8d061a22added988add2241ddeca857fd3a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 8 Oct 2007 09:54:00 +0000 Subject: [PATCH] - Fixed: The code that checked hitscans entering an actor from above and below calculated the hit position wrong. SVN r553 (trunk) --- docs/rh-log.txt | 4 ++++ src/m_menu.cpp | 6 +++++- src/p_trace.cpp | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 48f7c947d..d765f1372 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +October 8, 2007 (Changes by Graf Zahl) +- Fixed: The code that checked hitscans entering an actor from above and below + calculated the hit position wrong. + October 5, 2007 (Changes by Graf Zahl) - Fixed: Tne Imp's raise state sequence was wrong due to a typo. - Fixed: The shotgun had spawn ID 21 instead of 27. diff --git a/src/m_menu.cpp b/src/m_menu.cpp index eb4aaac0c..8d5367098 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -1709,7 +1709,11 @@ void M_VerifyNightmare (int ch) return; G_DeferedInitNew (EpisodeMaps[epi], 4); - gamestate = gamestate == GS_FULLCONSOLE ? GS_HIDECONSOLE : gamestate; + if (gamestate == GS_FULLCONSOLE) + { + gamestate = GS_HIDECONSOLE; + gameaction = ga_newgame; + } M_ClearMenus (); } diff --git a/src/p_trace.cpp b/src/p_trace.cpp index f4a775be2..eba70c36a 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -311,7 +311,8 @@ static bool PTR_TraceIterator (intercept_t *in) if (Vz >= 0) return true; // Going up: can't hit // Does it hit the top of the actor? - dist = StartZ - (in->d.thing->z + in->d.thing->height); + dist = FixedDiv(in->d.thing->z + in->d.thing->height - StartZ, Vz); + if (dist > MaxDist) return true; in->frac = FixedDiv(dist, MaxDist); @@ -324,7 +325,7 @@ static bool PTR_TraceIterator (intercept_t *in) if (Vz <= 0) return true; // Going down: can't hit // Does it hit the bottom of the actor? - dist = in->d.thing->z - StartZ; + dist = FixedDiv(in->d.thing->z - StartZ, Vz); if (dist > MaxDist) return true; in->frac = FixedDiv(dist, MaxDist);