ent->v->angles[1] += trace.fraction * pushangles[1];
SV_LinkEdict (ent, true);
- if (trace.ent && (!((int)ent->v->flags & FL_ONGROUND) || ent->v->groundentity != EDICT_TO_PROG(trace.ent)))
+ if (trace.fraction < 1 && trace.ent && (!((int)ent->v->flags & FL_ONGROUND) || ent->v->groundentity != EDICT_TO_PROG(trace.ent)))
SV_Impact (ent, trace.ent);
return trace;
}
vec3_t upmove, downmove, oldorg, oldvel, nosteporg, nostepvel, stepnormal;
trace_t downtrace;
+ SV_CheckVelocity(ent);
+
// do a regular slide move unless it looks like you ran into a step
oldonground = (int)ent->v->flags & FL_ONGROUND;
ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
clip = SV_FlyMove (ent, sv.frametime, NULL);
+ SV_CheckVelocity(ent);
+
// if move didn't block on a step, return
if ( !(clip & 2) )
return;
return;
}
- if (sv_nostep.integer)
- return;
+ SV_CheckVelocity(ent);
- if ( (int)ent->v->flags & FL_WATERJUMP )
+ if (sv_nostep.integer || (int)ent->v->flags & FL_WATERJUMP )
return;
VectorCopy (ent->v->origin, nosteporg);
VectorCopy (nosteporg, ent->v->origin);
VectorCopy (nostepvel, ent->v->velocity);
}
+
+ SV_CheckVelocity(ent);
}
//============================================================================
return;
}
+ // check if the entity crossed into or out of water
+ if ((ent->v->watertype == CONTENTS_WATER || ent->v->watertype == CONTENTS_SLIME) != (cont == CONTENTS_WATER || cont == CONTENTS_SLIME))
+ SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
+
if (cont <= CONTENTS_WATER)
{
- if (ent->v->watertype == CONTENTS_EMPTY && cont != CONTENTS_LAVA)
- // just crossed into water
- SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
-
ent->v->watertype = cont;
ent->v->waterlevel = 1;
}
else
{
- if (ent->v->watertype != CONTENTS_EMPTY && ent->v->watertype != CONTENTS_LAVA)
- // just crossed into water
- SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
-
ent->v->watertype = CONTENTS_EMPTY;
ent->v->waterlevel = 0;
}
if (pr_global_struct->force_retouch)
SV_LinkEdict (ent, true); // force retouch even for stationary
- if (i > 0 && i <= MAX_SCOREBOARD)
+ if (i > 0 && i <= svs.maxclients)
{
- if (!svs.connectedclients[i-1] || !svs.connectedclients[i-1]->spawned)
+ if (!svs.clients[i-1].spawned)
continue;
// connected slot
// call standard client pre-think
VectorMA(ent->v->angles, sv.frametime, ent->v->avelocity, ent->v->angles);
}
// relink normal entities here, players always get relinked so don't relink twice
- if (!(i > 0 && i <= MAX_SCOREBOARD))
+ if (!(i > 0 && i <= svs.maxclients))
SV_LinkEdict(ent, false);
break;
case MOVETYPE_STEP:
SV_Physics_Toss (ent);
break;
case MOVETYPE_FLY:
- if (i > 0 && i <= MAX_SCOREBOARD)
+ if (i > 0 && i <= svs.maxclients)
{
if (SV_RunThink (ent))
{
break;
}
- if (i > 0 && i <= MAX_SCOREBOARD && !ent->e->free)
+ if (i > 0 && i <= svs.maxclients && !ent->e->free)
{
SV_CheckVelocity (ent);