diff --git a/engine/common/bspfile.h b/engine/common/bspfile.h index f3220a200..f1eb7bad5 100644 --- a/engine/common/bspfile.h +++ b/engine/common/bspfile.h @@ -504,6 +504,10 @@ typedef struct #define SURF_FLOWING 0x40 // scroll towards angle #define SURF_NODRAW 0x80 // don't bother referencing the texture +#define SURF_NODRAW 0x80 // don't bother referencing the texture + +#define Q3SURF_LADDER 0x8 //wee + // content masks #define MASK_ALL (-1) #define MASK_SOLID (Q2CONTENTS_SOLID|Q2CONTENTS_WINDOW) diff --git a/engine/common/pmove.c b/engine/common/pmove.c index cac8ccfae..dd8439f79 100644 --- a/engine/common/pmove.c +++ b/engine/common/pmove.c @@ -726,6 +726,25 @@ void PM_CategorizePosition (void) //are we on a ladder? #ifdef Q2BSPS + if (pmove.physents[0].model->fromgame == fg_quake3) + { + trace_t t; + vec3_t flatforward, fwd1; + + flatforward[0] = forward[0]; + flatforward[1] = forward[1]; + flatforward[2] = 0; + VectorNormalize (flatforward); + + VectorMA (pmove.origin, 24, flatforward, fwd1); + + t = CM_BoxTrace(pmove.physents[0].model, pmove.origin, fwd1, player_mins, player_maxs, MASK_PLAYERSOLID); + if (t.surface->flags & Q3SURF_LADDER) + { + pmove.onladder = true; + pmove.onground = false; // too steep + } + } if (cont & FTECONTENTS_LADDER && pmove.physents[0].model->fromgame == fg_quake2) { trace_t t;