// regular thinking
if (!SV_RunThink (ent))
return;
-
+
VectorMA (ent->v.angles, sv.frametime, ent->v.avelocity, ent->v.angles);
VectorMA (ent->v.origin, sv.frametime, ent->v.velocity, ent->v.origin);
ent->v.waterlevel = 1;
return;
}
-
+
if (cont <= CONTENTS_WATER)
{
if (ent->v.watertype == CONTENTS_EMPTY)
{ // just crossed into water
SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
- }
+ }
ent->v.watertype = cont;
ent->v.waterlevel = 1;
}
if (ent->v.watertype != CONTENTS_EMPTY)
{ // just crossed into water
SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
- }
+ }
ent->v.watertype = CONTENTS_EMPTY;
ent->v.waterlevel = cont;
}
ClipVelocity (ent->v.velocity, trace.plane.normal, ent->v.velocity, backoff);
// stop if on ground
- if (trace.plane.normal[2] > 0.7)
+ if (ent->v.movetype == MOVETYPE_BOUNCEMISSILE)
+ ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
+ else if (ent->v.movetype == MOVETYPE_BOUNCE)
+ {
+ if (trace.plane.normal[2] > 0.7)
+ {
+ // LordHavoc: fixed grenades not bouncing when fired down a slope
+ if (DotProduct(trace.plane.normal, ent->v.velocity) < 100)
+ //if (ent->v.velocity[2] < 60)
+ {
+ ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
+ ent->v.groundentity = EDICT_TO_PROG(trace.ent);
+ VectorClear (ent->v.velocity);
+ VectorClear (ent->v.avelocity);
+ }
+ else
+ ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
+ }
+ else
+ ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
+ }
+ else
{
- // LordHavoc: fixed grenades not bouncing when fired down a slope
- if (fabs(ent->v.velocity[2]) < 60 || (ent->v.movetype != MOVETYPE_BOUNCE && ent->v.movetype != MOVETYPE_BOUNCEMISSILE))
- //if (ent->v.velocity[2] < 60 || (ent->v.movetype != MOVETYPE_BOUNCE && ent->v.movetype != MOVETYPE_BOUNCEMISSILE))
+ if (trace.plane.normal[2] > 0.7)
{
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
else
ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
}
- else
- ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
// check for in water
SV_CheckWaterTransition (ent);
break;
}
}
-
+
if (pr_global_struct->force_retouch)
- pr_global_struct->force_retouch--;
+ pr_global_struct->force_retouch--;
// LordHavoc: endframe support
if (EndFrameQC)