cvar_t sv_maxvelocity = {CVAR_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"};
cvar_t sv_nostep = {CVAR_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"};
cvar_t sv_stepheight = {CVAR_NOTIFY, "sv_stepheight", "18", "how high you can step up (TW_SV_STEPCONTROL extension)"};
-cvar_t sv_jumpstep = {CVAR_NOTIFY, "sv_jumpstep", "1", "whether you can step up while jumping (sv_gameplayfix_stepwhilejumping must also be 1)"};
+cvar_t sv_jumpstep = {CVAR_NOTIFY, "sv_jumpstep", "0", "whether you can step up while jumping (sv_gameplayfix_stepwhilejumping must also be 1)"};
cvar_t sv_wallfriction = {CVAR_NOTIFY, "sv_wallfriction", "1", "how much you slow down when sliding along a wall"};
cvar_t sv_newflymove = {CVAR_NOTIFY, "sv_newflymove", "0", "enables simpler/buggier player physics (not recommended)"};
cvar_t sv_freezenonclients = {CVAR_NOTIFY, "sv_freezenonclients", "0", "freezes time, except for players, allowing you to walk around and take screenshots of explosions"};
Cvar_RegisterVariable(&sv_sound_land);
}
+/*
+============
+SV_TestEntityPosition
+
+returns true if the entity is in solid currently
+============
+*/
+static int SV_TestEntityPosition (prvm_edict_t *ent, int movemode)
+{
+ return SV_Move (ent->fields.server->origin, ent->fields.server->mins, ent->fields.server->maxs, ent->fields.server->origin, movemode, ent).startsolid;
+}
+
/*
================
SV_CheckAllEnts
|| check->fields.server->movetype == MOVETYPE_NOCLIP)
continue;
- if (SV_TestEntityPosition (check))
+ if (SV_TestEntityPosition (check, MOVE_NORMAL))
Con_Print("entity in invalid position\n");
}
}
int i, j, z;
vec3_t org;
- if (!SV_TestEntityPosition(ent))
+ if (!SV_TestEntityPosition(ent, MOVE_NORMAL))
{
VectorCopy (ent->fields.server->origin, ent->fields.server->oldorigin);
return;
VectorCopy (ent->fields.server->origin, org);
VectorCopy (ent->fields.server->oldorigin, ent->fields.server->origin);
- if (!SV_TestEntityPosition(ent))
+ if (!SV_TestEntityPosition(ent, MOVE_NORMAL))
{
Con_DPrintf("Unstuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname));
SV_LinkEdict (ent, true);
ent->fields.server->origin[0] = org[0] + i;
ent->fields.server->origin[1] = org[1] + j;
ent->fields.server->origin[2] = org[2] + z;
- if (!SV_TestEntityPosition(ent))
+ if (!SV_TestEntityPosition(ent, MOVE_NORMAL))
{
Con_DPrintf("Unstuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname));
SV_LinkEdict (ent, true);
Con_DPrintf("Stuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname));
}
-void SV_UnstickEntity (prvm_edict_t *ent)
+static void SV_UnstickEntity (prvm_edict_t *ent)
{
int i, j, z;
vec3_t org;
+ // if not stuck in a bmodel, just return
+ if (!SV_TestEntityPosition(ent, MOVE_NOMONSTERS))
+ return;
+
VectorCopy (ent->fields.server->origin, org);
for (z=0 ; z< 18 ; z += 6)
ent->fields.server->origin[0] = org[0] + i;
ent->fields.server->origin[1] = org[1] + j;
ent->fields.server->origin[2] = org[2] + z;
- if (!SV_TestEntityPosition(ent))
+ if (!SV_TestEntityPosition(ent, MOVE_NOMONSTERS))
{
Con_DPrintf("Unstuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname));
SV_LinkEdict (ent, true);
if (downtrace.fraction < 1 && downtrace.plane.normal[2] > 0.7)
{
+ // this has been disabled so that you can't jump when you are stepping
+ // up while already jumping (also known as the Quake2 stair jump bug)
+#if 0
// LordHavoc: disabled this check so you can walk on monsters/players
//if (ent->fields.server->solid == SOLID_BSP)
{
ent->fields.server->flags = (int)ent->fields.server->flags | FL_ONGROUND;
ent->fields.server->groundentity = PRVM_EDICT_TO_PROG(downtrace.ent);
}
+#endif
}
else
{