SV_Move
==================
*/
+#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
+#if COLLISIONPARANOID >= 1
+trace_t SV_Move_(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t pEnd, int type, prvm_edict_t *passedict, int hitsupercontentsmask)
+#else
+trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t pEnd, int type, prvm_edict_t *passedict, int hitsupercontentsmask)
+#endif
+#else
#if COLLISIONPARANOID >= 1
trace_t SV_Move_(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask)
#else
trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask)
#endif
+#endif
{
vec3_t hullmins, hullmaxs;
int i, bodysupercontents;
int passedictprog;
- float pitchsign;
+ float pitchsign = 1;
qboolean pointtrace;
prvm_edict_t *traceowner, *touch;
trace_t trace;
// list of entities to test for collisions
int numtouchedicts;
prvm_edict_t *touchedicts[MAX_EDICTS];
+#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
+ vec3_t end;
+ vec_t len = 0;
+
+ if(!VectorCompare(start, pEnd))
+ {
+ // TRICK: make the trace 1 qu longer!
+ VectorSubtract(pEnd, start, end);
+ len = VectorNormalizeLength(end);
+ VectorAdd(pEnd, end, end);
+ }
+ else
+ VectorCopy(pEnd, end);
+#endif
VectorCopy(start, clipstart);
VectorCopy(end, clipend);
if (cliptrace.startsolid || cliptrace.fraction < 1)
cliptrace.ent = prog->edicts;
if (type == MOVE_WORLDONLY)
- return cliptrace;
+ goto finished;
if (type == MOVE_MISSILE)
{
// if the modelindex is 0, it shouldn't be SOLID_BSP!
if (modelindex > 0 && modelindex < MAX_MODELS)
model = sv.models[(int)touch->fields.server->modelindex];
- pitchsign = 1;
+ //pitchsign = 1;
if (
((modelindex = (int)touch->fields.server->modelindex) >= 1 && modelindex < MAX_MODELS && (model = sv.models[(int)touch->fields.server->modelindex]))
?
Collision_CombineTraces(&cliptrace, &trace, (void *)touch, touch->fields.server->solid == SOLID_BSP);
}
+finished:
+#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
+ if(!VectorCompare(start, pEnd))
+ Collision_ShortenTrace(&cliptrace, len / (len + 1), pEnd);
+#endif
return cliptrace;
}
// and groundentity is now freed, set groundentity to 0 (world)
// which leaves it suspended in the air
ent->fields.server->groundentity = 0;
- return;
+ if (sv_gameplayfix_noairborncorpse_allowsuspendeditems.integer)
+ return;
}
}
ent->priv.server->suspendedinairflag = false;
// ents in the first frame regardless)
qboolean runmove = ent->priv.server->move;
ent->priv.server->move = true;
- if (!runmove && sv_gameplayfix_delayprojectiles.integer)
+ if (!runmove && sv_gameplayfix_delayprojectiles.integer > 0)
return;
switch ((int) ent->fields.server->movetype)
{
// run physics on all the non-client entities
if (!sv_freezenonclients.integer)
+ {
for (;i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
if (!ent->priv.server->free)
SV_Physics_Entity(ent);
+ // make a second pass to see if any ents spawned this frame and make
+ // sure they run their move/think
+ if (sv_gameplayfix_delayprojectiles.integer < 0)
+ for (i = svs.maxclients + 1, ent = PRVM_EDICT_NUM(i);i < prog->num_edicts;i++, ent = PRVM_NEXT_EDICT(ent))
+ if (!ent->priv.server->move && !ent->priv.server->free)
+ SV_Physics_Entity(ent);
+ }
if (prog->globals.server->force_retouch > 0)
prog->globals.server->force_retouch = max(0, prog->globals.server->force_retouch - 1);