From 2440ab75b9cf52e17ae92a50ba951d8f08af9e53 Mon Sep 17 00:00:00 2001 From: Plagman Date: Mon, 16 Apr 2007 02:15:43 +0000 Subject: [PATCH] The Abyss crash fix. git-svn-id: https://svn.eduke32.com/eduke32@533 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/engine.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/polymer/build/src/engine.c b/polymer/build/src/engine.c index a21cb88f8..ea0a79c5f 100644 --- a/polymer/build/src/engine.c +++ b/polymer/build/src/engine.c @@ -8316,8 +8316,15 @@ long hitscan(long xs, long ys, long zs, short sectnum, long vx, long vy, long vz if ((cstat&64) != 0) if ((zs > intz) == ((cstat&8)==0)) continue; +#if 1 // Abyss crash prevention code ((intz-zs)*zx overflowing a 8-bit word) + zz=(long)((intz-zs)*vx); + intx = xs+scale(zz,1,vz); + zz=(long)((intz-zs)*vy); + inty = ys+scale(zz,1,vz); +#else intx = xs+scale(intz-zs,vx,vz); inty = ys+scale(intz-zs,vy,vz); +#endif if (klabs(intx-xs)+klabs(inty-ys) > klabs((*hitx)-xs)+klabs((*hity)-ys)) continue;