From 5d8aa174f01ef518f79bf634980fe59707974886 Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Mon, 24 Sep 2018 06:39:12 +0300 Subject: [PATCH] Added missing *_hull constants --- rehlds/engine/pmovetst.cpp | 22 +++++++++++----------- rehlds/engine/world.cpp | 8 ++++---- rehlds/public/rehlds/model.h | 1 + 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/rehlds/engine/pmovetst.cpp b/rehlds/engine/pmovetst.cpp index efdb8022a..c41f1ad06 100644 --- a/rehlds/engine/pmovetst.cpp +++ b/rehlds/engine/pmovetst.cpp @@ -165,7 +165,7 @@ int EXT_FUNC PM_PointContents(vec_t *p, int *truecontents) { int entityContents = PM_HullPointContents( pmove->physents[0].model->hulls, - pmove->physents[0].model->hulls[0].firstclipnode, + pmove->physents[0].model->hulls[point_hull].firstclipnode, p); if (truecontents) *truecontents = entityContents; @@ -198,7 +198,7 @@ int PM_WaterEntity(vec_t *p) #endif model_t* model = pmove->physents[0].model; - cont = PM_HullPointContents(model->hulls, model->hulls[0].firstclipnode, p); + cont = PM_HullPointContents(model->hulls, model->hulls[point_hull].firstclipnode, p); if (cont == CONTENTS_SOLID) { return CONTENTS_EMPTY; } @@ -212,7 +212,7 @@ int EXT_FUNC PM_TruePointContents(vec_t *p) if ((int)pmove->physents[0].model == -208) return CONTENTS_EMPTY; else - return PM_HullPointContents(pmove->physents[0].model->hulls, pmove->physents[0].model->hulls[0].firstclipnode, p); + return PM_HullPointContents(pmove->physents[0].model->hulls, pmove->physents[0].model->hulls[point_hull].firstclipnode, p); } hull_t *PM_HullForStudioModel(model_t *pModel, vec_t *offset, float frame, int sequence, const vec_t *angles, const vec_t *origin, const unsigned char *pcontroller, const unsigned char *pblending, int *pNumHulls) @@ -235,19 +235,19 @@ hull_t* EXT_FUNC PM_HullForBsp(physent_t *pe, vec_t *offset) switch (pmove->usehull) { case 1: - hull = &pe->model->hulls[3]; + hull = &pe->model->hulls[head_hull]; break; case 2: - hull = &pe->model->hulls[0]; + hull = &pe->model->hulls[point_hull]; break; case 3: - hull = &pe->model->hulls[2]; + hull = &pe->model->hulls[large_hull]; break; default: - hull = &pe->model->hulls[1]; + hull = &pe->model->hulls[human_hull]; break; } @@ -405,16 +405,16 @@ pmtrace_t _PM_PlayerTrace(vec_t *start, vec_t *end, int traceFlags, int numphyse switch (pmove->usehull) { case 1: - hull = &pe->model->hulls[3]; + hull = &pe->model->hulls[head_hull]; break; case 2: - hull = &pe->model->hulls[0]; + hull = &pe->model->hulls[point_hull]; break; case 3: - hull = &pe->model->hulls[2]; + hull = &pe->model->hulls[large_hull]; break; default: - hull = &pe->model->hulls[1]; + hull = &pe->model->hulls[human_hull]; break; } offset[0] = hull->clip_mins[0] - player_mins[pmove->usehull][0]; diff --git a/rehlds/engine/world.cpp b/rehlds/engine/world.cpp index 74ccc3346..0b5162c70 100644 --- a/rehlds/engine/world.cpp +++ b/rehlds/engine/world.cpp @@ -190,7 +190,7 @@ hull_t *SV_HullForBsp(edict_t *ent, const vec_t *mins, const vec_t *maxs, vec_t if (size[0] <= 8.0f) { - hull = &model->hulls[0]; + hull = &model->hulls[point_hull]; VectorCopy(hull->clip_mins, offset); } else @@ -202,13 +202,13 @@ hull_t *SV_HullForBsp(edict_t *ent, const vec_t *mins, const vec_t *maxs, vec_t #else if (size[2] <= 36.0f) #endif - hull = &model->hulls[3]; + hull = &model->hulls[head_hull]; else - hull = &model->hulls[1]; + hull = &model->hulls[human_hull]; } else { - hull = &model->hulls[2]; + hull = &model->hulls[large_hull]; } // calculate an offset value to center the origin diff --git a/rehlds/public/rehlds/model.h b/rehlds/public/rehlds/model.h index bcb952a9e..542974d36 100644 --- a/rehlds/public/rehlds/model.h +++ b/rehlds/public/rehlds/model.h @@ -204,6 +204,7 @@ typedef struct hull_s int lastclipnode; vec3_t clip_mins, clip_maxs; } hull_t; +typedef enum { point_hull = 0, human_hull = 1, large_hull = 2, head_hull = 3 }; typedef struct mspriteframe_t {