fix gb's 'help! they're crawling out of the walls! thing'

fix scrags+fish being affected by gravity at spawn

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4722 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-08-17 02:27:54 +00:00
parent 727b8d40db
commit 1da6377542
3 changed files with 31 additions and 8 deletions

View File

@ -1506,7 +1506,11 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
SCR_ImageName(server);
#endif
// run two frames to allow everything to settle
//these frames must be at 1.0 then 1.1 (and 0.1 frametime)
//(bug: starting less than that gives time for the scrag to fall on end)
realtime += 0.1;
sv.world.physicstime = 1.0;
sv.time = 1.1;
SV_Physics ();
#ifndef SERVERONLY
current_loading_size+=10;
@ -1514,9 +1518,11 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
SCR_ImageName(server);
#endif
realtime += 0.1;
// sv.world.physicstime = 1.1;
sv.time += 0.1;
sv.starttime -= 0.1;
SV_Physics ();
sv.time += 0.1;
#ifndef SERVERONLY
current_loading_size+=10;

View File

@ -845,7 +845,7 @@ SV_Push
*/
static qboolean WPhys_Push (world_t *w, wedict_t *pusher, vec3_t move, vec3_t amove)
{
#define PUSHABLE_LIMIT 32768
#define PUSHABLE_LIMIT 8192
int i, e;
wedict_t *check, *block;
vec3_t mins, maxs;
@ -862,8 +862,8 @@ static qboolean WPhys_Push (world_t *w, wedict_t *pusher, vec3_t move, vec3_t am
for (i=0 ; i<3 ; i++)
{
mins[i] = pusher->v->absmin[i] + move[i];
maxs[i] = pusher->v->absmax[i] + move[i];
mins[i] = pusher->v->absmin[i] + move[i]-(1/32.0);
maxs[i] = pusher->v->absmax[i] + move[i]+(1/32.0);
}
VectorCopy (pusher->v->origin, pushorig);
@ -2462,7 +2462,6 @@ qboolean SV_Physics (void)
}
if (!host_frametime)
continue;
sv.world.physicstime += host_frametime;
moved = true;
@ -2507,6 +2506,7 @@ qboolean SV_Physics (void)
NPP_Flush(); //flush it just in case there was an error and we stopped preparsing. This is only really needed while debugging.
sv.world.physicstime += host_frametime;
}
return moved;
}

View File

@ -476,6 +476,9 @@ void World_LinkEdict (world_t *w, wedict_t *ent, qboolean touch_triggers)
w->worldmodel->funcs.FindTouchedLeafs(w->worldmodel, &ent->pvsinfo, ent->v->absmin, ent->v->absmax);
}
// if (ent->v->solid == SOLID_NOT && !sv_gameplayfix_nolinknonsolid.ival)
// return;
// find the first node that the ent's box crosses
if (ent->v->solid == SOLID_PORTAL)
node = &w->portallist;
@ -897,7 +900,7 @@ wedict_t *World_TestEntityPosition (world_t *w, wedict_t *ent)
trace = World_Move (w, ent->v->origin, ent->v->mins, ent->v->maxs, ent->v->origin, ((ent->v->solid == SOLID_NOT || ent->v->solid == SOLID_TRIGGER)?MOVE_NOMONSTERS:0), ent);
if (trace.startsolid)
if (trace.startsolid || trace.allsolid)
return trace.ent?trace.ent:w->edicts;
return NULL;
@ -1649,9 +1652,12 @@ static void World_ClipToLinks (world_t *w, areanode_t *node, moveclip_t *clip)
else
trace = World_ClipMoveToEntity (w, touch, touch->v->origin, clip->start, clip->mins, clip->maxs, clip->end, clip->hullnum, clip->type & MOVE_HITMODEL, clip->hitcontentsmask);
if (trace.allsolid || trace.startsolid ||
trace.fraction < clip->trace.fraction)
if (trace.fraction < clip->trace.fraction)
{
//trace traveled less, but don't forget if we started in a solid.
trace.startsolid |= clip->trace.startsolid;
trace.allsolid |= clip->trace.allsolid;
if (clip->type & MOVE_ENTCHAIN)
{
touch->v->chain = EDICT_TO_PROG(w->progs, clip->trace.ent?clip->trace.ent:w->edicts);
@ -1659,10 +1665,21 @@ static void World_ClipToLinks (world_t *w, areanode_t *node, moveclip_t *clip)
}
else
{
trace.ent = touch;
if (clip->trace.startsolid && !trace.startsolid)
trace.ent = clip->trace.ent; //something else hit earlier, that one gets the trace entity, but not the fraction. yeah, combining traces like this was always going to be weird.
else
trace.ent = touch;
clip->trace = trace;
}
}
else if (trace.startsolid || trace.allsolid)
{
//even if the trace traveled less, we still care if it was in a solid.
clip->trace.startsolid |= trace.startsolid;
clip->trace.allsolid |= trace.allsolid;
if (!clip->trace.ent)
clip->trace.ent = touch;
}
}
// recurse down both sides