Fix ignore command.

Add cl_lerp_driftbias and cl_lerp_driftfrac cvars, to tweak drifting. changed defaults to try to reduce clamping.
Implement ladders with nq player physics.
Fix submodel contents with nq player physics.
Implemented drawrotpic_dp for compat (incompatible with fte's earlier implementation)
Added con_textfont cvar to set fonts without uglifying menuqc/csqc drawstrings that don't specify explicit fonts.
Enemycolor and teamcolor are now true cvars, which means they now work with seta.
Move the homedir from CSIDL_PERSONAL to CSIDL_LOCAL_APPDATA, because microsoft apparently scrape all CSIDL_PERSONAL data for upload to their servers, because they don't understand 'personal'. Will still use the old homedir if it exists.
Pack signon data without wasting so much, primarily to allow abusive mods to spew larger individual signon messages (hurrah for packet fragmentation).


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5546 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2019-09-17 19:49:39 +00:00
parent 40b7193cef
commit 131a6be4bc
27 changed files with 523 additions and 165 deletions

View file

@ -53,6 +53,7 @@ typedef struct
qboolean capsule;
} moveclip_t;
static unsigned int World_ContentsOfAllLinks (world_t *w, vec3_t pos);
/*
===============================================================================
@ -123,7 +124,7 @@ hull_t *World_HullForBox (vec3_t mins, vec3_t maxs)
return &box_hull;
}
model_t mod_capsule;
static model_t mod_capsule;
qboolean World_BoxTrace(struct model_s *model, int hulloverride, int frame, vec3_t axis[3], vec3_t p1, vec3_t p2, vec3_t mins, vec3_t maxs, unsigned int against, struct trace_s *trace)
{
hull_t *hull = &box_hull;
@ -1151,11 +1152,18 @@ SV_PointContents
==================
*/
int World_PointContents (world_t *w, vec3_t p)
int World_PointContentsWorldOnly (world_t *w, vec3_t p)
{
return w->worldmodel->funcs.PointContents(w->worldmodel, NULL, p);
}
int World_PointContentsAllBSPs (world_t *w, vec3_t p)
{
int c = w->worldmodel->funcs.PointContents(w->worldmodel, NULL, p);
c |= World_ContentsOfAllLinks(w, p);
return c;
}
//===========================================================================
/*
@ -1326,7 +1334,7 @@ static trace_t World_ClipMoveToEntity (world_t *w, wedict_t *ent, vec3_t eorg, v
{
memset (&trace, 0, sizeof(trace_t));
trace.fraction = 1;
trace.allsolid = true;
trace.allsolid = false;
trace.startsolid = false;
trace.inopen = true; //probably wrong...
VectorCopy (end, trace.endpos);
@ -1460,13 +1468,13 @@ int World_AreaEdicts (world_t *w, vec3_t mins, vec3_t maxs, wedict_t **list, int
}
#else
float *area_mins, *area_maxs;
wedict_t **area_list;
static float *area_mins, *area_maxs;
static wedict_t **area_list;
#ifdef Q2SERVER
q2edict_t **area_q2list;
static q2edict_t **area_q2list;
#endif
int area_count, area_maxcount;
int area_type;
static int area_count, area_maxcount;
static int area_type;
static void World_AreaEdicts_r (areanode_t *node)
{
link_t *l, *next, *start;
@ -2088,6 +2096,95 @@ static void World_ClipToAllLinks (world_t *w, moveclip_t *clip)
World_ClipToLinks(w, &w->gridareas[g[0] + g[1]*w->gridsize[0]], clip);
}
}
static unsigned int World_ContentsOfLinks (world_t *w, areagridlink_t *node, vec3_t pos)
{
link_t *l, *next;
wedict_t *touch;
model_t *model;
int mdlidx;
vec3_t pos_l, axis[3];
unsigned int ret = 0, c;
// touch linked edicts
for (l = node->l.next ; l != &node->l ; l = next)
{
next = l->next;
touch = ((areagridlink_t*)l)->ed;
if (touch->gridareasequence == areagridsequence)
continue;
touch->gridareasequence = areagridsequence;
if (touch->v->solid != SOLID_BSP)
continue;
if ( pos[0] > touch->v->absmax[0]
|| pos[1] > touch->v->absmax[1]
|| pos[2] > touch->v->absmax[2]
|| pos[0] < touch->v->absmin[0]
|| pos[1] < touch->v->absmin[1]
|| pos[2] < touch->v->absmin[2] )
continue;
// if (touch->v->solid == SOLID_PORTAL)
// //FIXME: recurse!
mdlidx = touch->v->modelindex;
if (!mdlidx)
continue;
model = w->Get_CModel(w, mdlidx);
if (!model || (model->type != mod_brush && model->type != mod_heightmap) || model->loadstate != MLS_LOADED)
continue;
VectorSubtract (pos, touch->v->origin, pos_l);
if (touch->v->angles[0] || touch->v->angles[1] || touch->v->angles[2])
{
AngleVectors (touch->v->angles, axis[0], axis[1], axis[2]);
VectorNegate(axis[1], axis[1]);
c = model->funcs.PointContents(model, axis, pos_l);
}
else
c = model->funcs.PointContents(model, NULL, pos_l);
if (c && touch->v->skin < 0)
{ //if forcedcontents is set, then ALL brushes in this model are forced to the specified contents value.
//we achive this by tracing against ALL then forcing it after.
unsigned int forcedcontents;
switch((int)touch->v->skin)
{
case Q1CONTENTS_EMPTY: forcedcontents = FTECONTENTS_EMPTY; break;
case Q1CONTENTS_SOLID: forcedcontents = FTECONTENTS_SOLID; break;
case Q1CONTENTS_WATER: forcedcontents = FTECONTENTS_WATER; break;
case Q1CONTENTS_SLIME: forcedcontents = FTECONTENTS_SLIME; break;
case Q1CONTENTS_LAVA: forcedcontents = FTECONTENTS_LAVA; break;
case Q1CONTENTS_SKY: forcedcontents = FTECONTENTS_SKY; break;
case Q1CONTENTS_LADDER: forcedcontents = FTECONTENTS_LADDER;break;
default: forcedcontents = 0; break;
}
c = forcedcontents;
}
ret |= c;
}
return ret;
}
static unsigned int World_ContentsOfAllLinks (world_t *w, vec3_t pos)
{
int ming[2], maxg[2], g[2];
unsigned int ret;
areagridsequence++;
ret = World_ContentsOfLinks(w, &w->jumboarea, pos);
CALCAREAGRIDBOUNDS(w, pos, pos);
for ( g[0] = ming[0]; g[0] < maxg[0]; g[0]++)
for (g[1] = ming[1]; g[1] < maxg[1]; g[1]++)
{
ret |= World_ContentsOfLinks(w, &w->gridareas[g[0] + g[1]*w->gridsize[0]], pos);
}
return ret;
}
#else
/*
====================
@ -2227,6 +2324,62 @@ static void World_ClipToLinks (world_t *w, areanode_t *node, moveclip_t *clip)
if ( clip->boxmins[node->axis] < node->dist )
World_ClipToLinks (w, node->children[1], clip );
}
static unsigned int World_ContentsOfLinks (world_t *w, areanode_t *node, vec3_t pos)
{
unsigned int c = 0;
link_t *l, *next;
wedict_t *touch;
trace_t trace;
// touch linked edicts
for (l = node->edicts.next ; l != &node->edicts ; l = next)
{
next = l->next;
touch = EDICT_FROM_AREA(l);
if (touch->v->solid == SOLID_NOT)
continue;
/*if its a trigger, we only clip against it if the flags are aligned*/
if (touch->v->solid == SOLID_TRIGGER)
continue;
if (pos[0] > touch->v->absmax[0]
|| pos[1] > touch->v->absmax[1]
|| pos[2] > touch->v->absmax[2]
|| pos[0] < touch->v->absmin[0]
|| pos[1] < touch->v->absmin[1]
|| pos[2] < touch->v->absmin[2] )
continue;
/*if (touch->v->solid == SOLID_PORTAL)
{
//make sure we don't hit the world if we're inside the portal
World_PortalCSG(touch, vec3_origin, vec3_origin, pos, pos, &clip->trace);
}*/
trace = World_ClipMoveToEntity (w, touch, touch->v->origin, touch->v->angles, pos, vec3_origin, vec3_origin, pos, 0, false, false, ~0u);
if (trace.startsolid)
c |= trace.contents;
}
// recurse down both sides
if (node->axis == -1)
return c;
if ( pos[node->axis] > node->dist )
c |= World_ContentsOfLinks (w, node->children[0], pos );
if ( pos[node->axis] < node->dist )
c |= World_ContentsOfLinks (w, node->children[1], pos );
return c;
}
static unsigned int World_ContentsOfAllLinks (world_t *w, vec3_t pos)
{
return World_ContentsOfLinks(w, w->areanodes, pos);
}
#endif
#if defined(HAVE_CLIENT) && defined(CSQC_DAT)
@ -2329,6 +2482,9 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
}*/
}
if (model && touchcontents != ~0)
trace.contents = touchcontents;
if (trace.fraction < clip->trace.fraction)
{
//trace traveled less, but don't forget if we started in a solid.