From bee92c65e5e24f12926ad3c9d553574de719c5c1 Mon Sep 17 00:00:00 2001 From: flowtron Date: Mon, 19 Jul 2021 15:14:16 +0200 Subject: [PATCH] fix plclip step up --- source/src/physics.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index e48e7ed3..b5920ca6 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -139,14 +139,13 @@ bool mmcollide(physent *d, float &hi, float &lo) // collide with a map for(int i = clentstats.firstclip; i < ents.length(); i++) { entity &e = ents[i]; - // if(e.type==CLIP || (e.type == PLCLIP && d->type == ENT_PLAYER)) - if (e.type==CLIP || (e.type == PLCLIP && (d->type == ENT_BOT || d->type == ENT_PLAYER || (d->type == ENT_BOUNCE && ((bounceent *)d)->plclipped)))) // don't allow bots to hack themselves into plclips - Bukz 2011/04/14 + if (e.type==CLIP || (e.type == PLCLIP && (d->type == ENT_BOT || d->type == ENT_PLAYER || (d->type == ENT_BOUNCE && ((bounceent *)d)->plclipped)))) { bool hitarea = false; switch(e.attr7 & 3) { default: // classic unrotated clip, possibly tilted - hitarea = fabs(e.x - d->o.x) < float(e.attr2) / ENTSCALE5 + d->radius && fabs(e.y - d->o.y) < float(e.attr3) / ENTSCALE5 + d->radius; + hitarea = (fabs(e.x - d->o.x) - (float(e.attr2) / ENTSCALE5 + useradius) < 1e-5) && (fabs(e.y - d->o.y) - (float(e.attr3) / ENTSCALE5 + useradius) < 1e-5); // fix PLCLIP-step-up bug where e.g. 2.1<=2.1 was FALSE [sic!] break; case 3: // clip rotated 45° {