#endif
// clip to world
- Collision_ClipLineToWorld(&cliptrace, sv.worldmodel, clipstart, clipend, hitsupercontentsmask);
+ Collision_ClipLineToWorld(&cliptrace, sv.worldmodel, clipstart, clipend, hitsupercontentsmask, false);
cliptrace.bmodelstartsolid = cliptrace.startsolid;
if (cliptrace.startsolid || cliptrace.fraction < 1)
cliptrace.ent = prog->edicts;
if (type == MOVE_MISSILE && (int)touch->fields.server->flags & FL_MONSTER)
Collision_ClipToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
else
- Collision_ClipLineToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipend, hitsupercontentsmask);
+ Collision_ClipLineToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.server->mins, touch->fields.server->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipend, hitsupercontentsmask, false);
Collision_CombineTraces(&cliptrace, &trace, (void *)touch, touch->fields.server->solid == SOLID_BSP);
}
SV_Impact
Two entities have touched, so run their touch functions
-returns true if the impact kept the origin of the touching entity intact
==================
*/
extern void VM_SetTraceGlobals(const trace_t *trace);
extern sizebuf_t vm_tempstringsbuf;
-qboolean SV_Impact (prvm_edict_t *e1, trace_t *trace)
+void SV_Impact (prvm_edict_t *e1, trace_t *trace)
{
int restorevm_tempstringsbuf_cursize;
int old_self, old_other;
- vec3_t org;
prvm_edict_t *e2 = (prvm_edict_t *)trace->ent;
prvm_eval_t *val;
old_other = prog->globals.server->other;
restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize;
- VectorCopy(e1->fields.server->origin, org);
-
VM_SetTraceGlobals(trace);
prog->globals.server->time = sv.time;
prog->globals.server->self = old_self;
prog->globals.server->other = old_other;
vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
-
- return VectorCompare(e1->fields.server->origin, org);
}
if (time <= 0)
return 0;
gravity = 0;
+
+ if(sv_gameplayfix_nogravityonground.integer)
+ if((int)ent->fields.server->flags & FL_ONGROUND)
+ applygravity = false;
+
if (applygravity)
{
if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
//Con_Printf("step %f %f %f : ", ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2]);
VectorSet(steppush, 0, 0, stepheight);
VectorCopy(ent->fields.server->origin, org);
- SV_PushEntity(&steptrace, ent, steppush, false, false);
+ if(!SV_PushEntity(&steptrace, ent, steppush, false, false))
+ {
+ blocked |= 8;
+ break;
+ }
//Con_Printf("%f %f %f : ", ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2]);
- SV_PushEntity(&steptrace2, ent, push, false, false);
+ if(!SV_PushEntity(&steptrace2, ent, push, false, false))
+ {
+ blocked |= 8;
+ break;
+ }
//Con_Printf("%f %f %f : ", ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2]);
VectorSet(steppush, 0, 0, org[2] - ent->fields.server->origin[2]);
- SV_PushEntity(&steptrace3, ent, steppush, false, false);
+ if(!SV_PushEntity(&steptrace3, ent, steppush, false, false))
+ {
+ blocked |= 8;
+ break;
+ }
//Con_Printf("%f %f %f : ", ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2]);
// accept the new position if it made some progress...
if (fabs(ent->fields.server->origin[0] - org[0]) >= 0.03125 || fabs(ent->fields.server->origin[1] - org[1]) >= 0.03125)
{
int type;
int bump;
- vec3_t original;
+ vec3_t original, original_velocity;
vec3_t end;
VectorCopy(ent->fields.server->origin, original);
if (trace->bmodelstartsolid && failonbmodelstartsolid)
return true;
-
VectorCopy (trace->endpos, ent->fields.server->origin);
+
+ VectorCopy(ent->fields.server->origin, original);
+ VectorCopy(ent->fields.server->velocity, original_velocity);
+
SV_LinkEdict(ent);
#if 0
SV_LinkEdict_TouchAreaGrid(ent);
if((ent->fields.server->solid >= SOLID_TRIGGER && trace->ent && (!((int)ent->fields.server->flags & FL_ONGROUND) || ent->fields.server->groundentity != PRVM_EDICT_TO_PROG(trace->ent))))
- return SV_Impact (ent, trace);
+ SV_Impact (ent, trace);
- return true;
+ return VectorCompare(ent->fields.server->origin, original) && VectorCompare(ent->fields.server->velocity, original_velocity);
}
*/
void SV_WalkMove (prvm_edict_t *ent)
{
- int clip, oldonground, originalmove_clip, originalmove_flags, originalmove_groundentity, hitsupercontentsmask, type;
+ int clip;
+ int oldonground;
+ //int originalmove_clip;
+ int originalmove_flags;
+ int originalmove_groundentity;
+ int hitsupercontentsmask;
+ int type;
vec3_t upmove, downmove, start_origin, start_velocity, stepnormal, originalmove_origin, originalmove_velocity;
trace_t downtrace, trace;
qboolean applygravity;
VectorCopy(ent->fields.server->origin, originalmove_origin);
VectorCopy(ent->fields.server->velocity, originalmove_velocity);
- originalmove_clip = clip;
+ //originalmove_clip = clip;
originalmove_flags = (int)ent->fields.server->flags;
originalmove_groundentity = ent->fields.server->groundentity;