ent->v.waterlevel = 0;
ent->v.watertype = CONTENTS_EMPTY;
- cont = Mod_PointInLeaf(point, sv.worldmodel)->contents;
+ cont = Mod_PointContents(point, sv.worldmodel);
if (cont <= CONTENTS_WATER)
{
ent->v.watertype = cont;
ent->v.waterlevel = 1;
point[2] = ent->v.origin[2] + (ent->v.mins[2] + ent->v.maxs[2])*0.5;
- cont = Mod_PointInLeaf(point, sv.worldmodel)->contents;
+ cont = Mod_PointContents(point, sv.worldmodel);
if (cont <= CONTENTS_WATER)
{
ent->v.waterlevel = 2;
point[2] = ent->v.origin[2] + ent->v.view_ofs[2];
- cont = Mod_PointInLeaf(point, sv.worldmodel)->contents;
+ cont = Mod_PointContents(point, sv.worldmodel);
if (cont <= CONTENTS_WATER)
ent->v.waterlevel = 3;
}
// check for stuckness, possibly due to the limited precision of floats
// in the clipping hulls
- /*
if (clip
&& fabs(oldorg[1] - ent->v.origin[1]) < 0.03125
&& fabs(oldorg[0] - ent->v.origin[0]) < 0.03125)
// stepping up didn't make any progress
clip = SV_TryUnstick (ent, oldvel);
- */
// extra friction based on view angle
if (clip & 2 && sv_wallfriction.integer)
if (downtrace.plane.normal[2] > 0.7)
{
- if (ent->v.solid == SOLID_BSP)
+ //if (ent->v.solid == SOLID_BSP)
{
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
ent->v.groundentity = EDICT_TO_PROG(downtrace.ent);
*/
void SV_CheckWaterTransition (edict_t *ent)
{
- int cont;
- cont = Mod_PointInLeaf(ent->v.origin, sv.worldmodel)->contents;
+ int cont;
+ cont = Mod_PointContents(ent->v.origin, sv.worldmodel);
if (!ent->v.watertype)
{
// just spawned here
{
if (flags & FL_FLY)
fall = false;
- else if ((flags & FL_SWIM) && Mod_PointInLeaf(ent->v.origin, sv.worldmodel)->contents != CONTENTS_EMPTY)
+ else if ((flags & FL_SWIM) && Mod_PointContents(ent->v.origin, sv.worldmodel) != CONTENTS_EMPTY)
fall = false;
}
if (fall && (flags & FL_ONGROUND) && ent->v.groundentity == 0)