pr_global_struct->time = thinktime;
pr_global_struct->self = EDICT_TO_PROG(ent);
pr_global_struct->other = EDICT_TO_PROG(sv.edicts);
- PR_ExecuteProgram (ent->v->think, "NULL think function");
+ PR_ExecuteProgram (ent->v->think, "QC function self.think is missing");
return !ent->e->free;
}
{
pr_global_struct->self = EDICT_TO_PROG(e1);
pr_global_struct->other = EDICT_TO_PROG(e2);
- PR_ExecuteProgram (e1->v->touch, "");
+ PR_ExecuteProgram (e1->v->touch, "QC function self.touch is missing");
}
if (e2->v->touch && e2->v->solid != SOLID_NOT)
{
pr_global_struct->self = EDICT_TO_PROG(e2);
pr_global_struct->other = EDICT_TO_PROG(e1);
- PR_ExecuteProgram (e2->v->touch, "");
+ PR_ExecuteProgram (e2->v->touch, "QC function self.touch is missing");
}
pr_global_struct->self = old_self;
{
pr_global_struct->self = EDICT_TO_PROG(pusher);
pr_global_struct->other = EDICT_TO_PROG(check);
- PR_ExecuteProgram (pusher->v->blocked, "");
+ PR_ExecuteProgram (pusher->v->blocked, "QC function self.blocked is missing");
}
break;
}
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(ent);
pr_global_struct->other = EDICT_TO_PROG(sv.edicts);
- PR_ExecuteProgram (ent->v->think, "NULL think function");
+ PR_ExecuteProgram (ent->v->think, "QC function self.think is missing");
}
}
originalmove_flags = (int)ent->v->flags;
originalmove_groundentity = ent->v->groundentity;
+ if ((int)ent->v->flags & FL_WATERJUMP)
+ return;
+
+ if (sv_nostep.integer)
+ return;
+
// if move didn't block on a step, return
if (clip & 2)
{
if (fabs(start_velocity[0]) < 0.03125 && fabs(start_velocity[1]) < 0.03125)
return;
- if (sv_nostep.integer)
- return;
-
- if ((int)ent->v->flags & FL_WATERJUMP)
- return;
-
if (ent->v->movetype != MOVETYPE_FLY)
{
// return if gibbed by a trigger
if (clip & 2 && sv_wallfriction.integer)
SV_WallFriction (ent, stepnormal);
}
- else if (!sv_gameplayfix_stepdown.integer || !oldonground || ((int)ent->v->flags & FL_ONGROUND))
+ // skip out if stepdown is enabled, moving downward, not in water, and the move started onground and ended offground
+ else if (!(sv_gameplayfix_stepdown.integer && ent->v->waterlevel < 2 && start_velocity[2] < (1.0 / 32.0) && oldonground && !((int)ent->v->flags & FL_ONGROUND)))
return;
// move down
if (!SV_RunThink (ent))
return;
+ // don't stick to ground if onground and moving upward
+ if (ent->v->velocity[2] >= (1.0 / 32.0) && ((int)ent->v->flags & FL_ONGROUND))
+ ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
+
// if onground, return without moving
if ((int)ent->v->flags & FL_ONGROUND)
{
*/
void SV_Physics_Step (edict_t *ent)
{
+ // don't stick to ground if onground and moving upward
+ if (ent->v->velocity[2] >= (1.0 / 32.0) && ((int)ent->v->flags & FL_ONGROUND))
+ ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
+
// freefall if not onground/fly/swim
if (!((int)ent->v->flags & (FL_ONGROUND | FL_FLY | FL_SWIM)))
{
if (pr_global_struct->force_retouch)
SV_LinkEdict (ent, true); // force retouch even for stationary
- if (i <= svs.maxclients)
+ if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned)
{
- if (i > 0)
- {
- if (!svs.clients[i-1].spawned)
- continue;
- // connected slot
- // call standard client pre-think
- SV_CheckVelocity (ent);
- pr_global_struct->time = sv.time;
- pr_global_struct->self = EDICT_TO_PROG(ent);
- PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "QC function PlayerPreThink is missing");
- SV_CheckVelocity (ent);
- }
+ // connected slot
+ // call standard client pre-think
+ SV_CheckVelocity (ent);
+ pr_global_struct->time = sv.time;
+ pr_global_struct->self = EDICT_TO_PROG(ent);
+ PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "QC function PlayerPreThink is missing");
+ SV_CheckVelocity (ent);
}
else if (sv_freezenonclients.integer)
continue;
break;
}
- if (i <= svs.maxclients && i > 0 && !ent->e->free)
+ if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned)
{
SV_CheckVelocity (ent);
pr_global_struct->self = EDICT_TO_PROG(sv.edicts);
pr_global_struct->other = EDICT_TO_PROG(sv.edicts);
pr_global_struct->time = sv.time;
- PR_ExecuteProgram ((func_t)(EndFrameQC - pr_functions), "");
+ PR_ExecuteProgram ((func_t)(EndFrameQC - pr_functions), "QC function EndFrame is missing");
}
if (!sv_freezenonclients.integer)