Skip to content

Commit

Permalink
Added missing *_hull constants
Browse files Browse the repository at this point in the history
  • Loading branch information
WPMGPRoSToTeMa committed Sep 24, 2018
1 parent c8612a6 commit 5d8aa17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
22 changes: 11 additions & 11 deletions rehlds/engine/pmovetst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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)
Expand All @@ -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;
}

Expand Down Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions rehlds/engine/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions rehlds/public/rehlds/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 5d8aa17

Please sign in to comment.