fix some compile issues (errors and warnings). sdl, ode, vulkan.
fix q2bsp textures. fix some vulkan validation issues. MOVE_OTHERONLY is now an official feature (replacing MOVE_ONLYENT which is now removed, same functionality, better behaved behaviour). network up edited brushes on initial connect. still needs more work for entity editing, but should otherwise be okay for now. add sys_browserredirect console command for emscripten builds (can be used to trigger window redirections - including download requests) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5001 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
27a59a0cbc
commit
934a97c53e
65 changed files with 9051 additions and 4750 deletions
|
@ -9579,7 +9579,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
|
|||
{"vectoyaw", PF_vectoyaw, 13, 13, 13, 0, D("float(vector v, optional entity reference)", "Given a direction vector, returns the yaw angle in which that direction vector points. If an entity is passed, the yaw angle will be relative to that entity's gravity direction.")},
|
||||
{"spawn", PF_Spawn, 14, 14, 14, 0, D("entity()", "Adds a brand new entity into the world! Hurrah, you're now a parent!")},
|
||||
{"remove", PF_Remove, 15, 15, 15, 0, D("void(entity e)", "Destroys the given entity and clears some limited fields (including model, modelindex, solid, classname). Any references to the entity following the call are an error. After two seconds, the entity will be reused, in the interim you can unfortunatly still read its fields to see if the reference is no longer valid.")},
|
||||
{"traceline", PF_svtraceline, 16, 16, 16, 0, D("void(vector v1, vector v2, float flags, entity ent)", "Traces an infinitely thin line through the world from v1 towards v2.\nWill not collide with ent, ent.owner, or any entity who's owner field refers to ent.\nThere are no side effects beyond the trace_* globals being written.\nflags&MOVE_NOMONSTERS will not impact on non-bsp entities.\nflags&MOVE_MISSILE will impact with increased size.\nflags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes.\nflags&MOVE_TRIGGERS will also stop on triggers\nflags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities.\nflags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation.")},
|
||||
{"traceline", PF_svtraceline, 16, 16, 16, 0, D("void(vector v1, vector v2, float flags, entity ent)", "Traces an infinitely thin line through the world from v1 towards v2.\nWill not collide with ent, ent.owner, or any entity who's owner field refers to ent.\nThe passed entity will also be used to determine whether to use a capsule trace, the contents that the trace should impact, and a couple of other extra fields that define the trace.\nThere are no side effects beyond the trace_* globals being written.\nflags&MOVE_NOMONSTERS will not impact on non-bsp entities.\nflags&MOVE_MISSILE will impact with increased size.\nflags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes.\nflags&MOVE_TRIGGERS will also stop on triggers\nflags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities.\nflags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation.")},
|
||||
{"checkclient", PF_checkclient, 17, 17, 17, 0, D("entity()", "Returns one of the player entities. The returned player will change periodically.")},
|
||||
{"find", PF_FindString, 18, 18, 18, 0, D("entity(entity start, .string fld, string match)", "Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more.")},
|
||||
{"precache_sound", PF_precache_sound, 19, 19, 19, 0, D("string(string s)", "Precaches a sound, making it known to clients and loading it from disk. This builtin (strongly) should be called during spawn functions. This builtin must be called for the sound before the sound builtin is called, or it might not even be heard.")},
|
||||
|
@ -11396,7 +11396,7 @@ void PR_DumpPlatform_f(void)
|
|||
{"MOVE_EVERYTHING", "const float", QW|NQ|CS, "This type of trace will hit solids and triggers alike. Even non-solid entities.", MOVE_EVERYTHING},
|
||||
{"MOVE_LAGGED", "const float", QW|NQ, "Will use antilag based upon the player's latency. Traces will be performed against old positions for entities instead of their current origin.", MOVE_LAGGED},
|
||||
{"MOVE_ENTCHAIN", "const float", QW|NQ|CS, "Returns a list of entities impacted via the trace_ent.chain field", MOVE_ENTCHAIN},
|
||||
// {"MOVE_ONLYENT", "const float", QW|NQ|CS, "Traces that use this trace type will collide against *only* the entity specified, and will ignore all owner/solid/dimension etc fields, they will still adhere to contents though.", MOVE_ONLYENT},
|
||||
{"MOVE_OTHERONLY", "const float", QW|NQ|CS, "Traces that use this trace type will collide against *only* the entity specified via the 'other' global, and will ignore all owner/solid_not/dimension etc rules, they will still adhere to contents and bsp/bbox rules though.", MOVE_OTHERONLY},
|
||||
|
||||
{"RESTYPE_MODEL", "const float", ALL, "RESTYPE_* constants are used as arguments with the resourcestatus builtin.", RESTYPE_MODEL},
|
||||
{"RESTYPE_SOUND", "const float", ALL, "precache_sound", RESTYPE_SOUND},
|
||||
|
|
|
@ -378,7 +378,9 @@ enum
|
|||
PRESPAWN_SPAWNSTATIC,
|
||||
PRESPAWN_AMBIENTSOUND,
|
||||
PRESPAWN_BASELINES,
|
||||
PRESPAWN_DONE
|
||||
PRESPAWN_SPAWN,
|
||||
PRESPAWN_BRUSHES,
|
||||
PRESPAWN_COMPLETED
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -402,6 +404,7 @@ typedef struct client_s
|
|||
|
||||
unsigned int prespawn_stage;
|
||||
unsigned int prespawn_idx;
|
||||
unsigned int prespawn_idx2;
|
||||
qboolean prespawn_allow_modellist;
|
||||
qboolean prespawn_allow_soundlist;
|
||||
|
||||
|
|
|
@ -4028,7 +4028,9 @@ qboolean SV_ReadPackets (float *delay)
|
|||
|
||||
if (cl->delay > 0)
|
||||
{
|
||||
#ifdef NQPROT
|
||||
dominping:
|
||||
#endif
|
||||
if (cl->state < cs_connected)
|
||||
break;
|
||||
if (net_message.cursize > sizeof(svs.free_lagged_packet->data))
|
||||
|
|
|
@ -1864,7 +1864,7 @@ void SV_MVD_SendInitialGamestate(mvddest_t *dest)
|
|||
demo.recorder.prespawn_stage = PRESPAWN_SERVERINFO;
|
||||
demo.recorder.prespawn_idx = 0;
|
||||
demo.recorder.netchan.message = buf;
|
||||
while (demo.recorder.prespawn_stage != PRESPAWN_DONE)
|
||||
while (demo.recorder.prespawn_stage != PRESPAWN_COMPLETED)
|
||||
{
|
||||
if (demo.recorder.prespawn_stage == PRESPAWN_MAPCHECK)
|
||||
{
|
||||
|
|
|
@ -3138,12 +3138,11 @@ void SV_SendClientMessages (void)
|
|||
}
|
||||
|
||||
SV_ReplaceEntityFrame(c, c->netchan.outgoing_sequence);
|
||||
SV_SendClientPrespawnInfo(c);
|
||||
if (c->state == cs_spawned)
|
||||
SV_SendClientDatagram (c);
|
||||
else
|
||||
{
|
||||
SV_SendClientPrespawnInfo(c);
|
||||
|
||||
SV_DarkPlacesDownloadChunk(c, &c->datagram);
|
||||
fnum = c->netchan.outgoing_sequence;
|
||||
sentbytes = Netchan_Transmit (&c->netchan, c->datagram.cursize, c->datagram.data, SV_RateForClient(c)); // just update reliable
|
||||
|
|
|
@ -560,11 +560,13 @@ char *Sys_ConsoleInput (void)
|
|||
static char text[256];
|
||||
int len;
|
||||
|
||||
#ifdef SUBSERVERS
|
||||
if (SSV_IsSubServer())
|
||||
{
|
||||
SSV_CheckFromMaster();
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!stdin_ready || !do_stdin)
|
||||
return NULL; // the select didn't say it was ready
|
||||
|
|
|
@ -938,7 +938,7 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
|||
//much of this function is written to fill packets enough to overflow them (assuming max packet sizes are large enough), but some bits are lazy and just backbuffer as needed.
|
||||
//FIXME: have per-stage indicies, to allow returning to a previous stage when new precaches or whatever get added
|
||||
|
||||
if (client->num_backbuf || client->prespawn_stage == PRESPAWN_DONE)
|
||||
if (client->num_backbuf || client->prespawn_stage == PRESPAWN_COMPLETED)
|
||||
{
|
||||
//don't spam too much.
|
||||
return;
|
||||
|
@ -1368,6 +1368,7 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
|||
{
|
||||
client->prespawn_stage++;
|
||||
client->prespawn_idx = 0;
|
||||
client->prespawn_idx2 = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1513,24 +1514,37 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
|||
client->prespawn_idx++;
|
||||
}
|
||||
}
|
||||
if (client->prespawn_stage == PRESPAWN_DONE)
|
||||
if (client->prespawn_stage == PRESPAWN_SPAWN)
|
||||
{
|
||||
if (!client->prespawn_idx)
|
||||
//we'll spawn the client and then send all the updating stuff only when we know the channel is clear, by pinging the client for it.
|
||||
if (ISNQCLIENT(client))
|
||||
{
|
||||
//we'll spawn the client and then send all the updating stuff only when we know the channel is clear, by pinging the client for it.
|
||||
if (ISNQCLIENT(client))
|
||||
//effectively a cmd spawn... but also causes the client to actually send the player's name too.
|
||||
ClientReliableWrite_Begin (client, svc_signonnum, 2);
|
||||
ClientReliableWrite_Byte (client, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *cmd = va("cmd spawn %i\n",svs.spawncount);
|
||||
ClientReliableWrite_Begin(client, svc_stufftext, 2+strlen(cmd));
|
||||
ClientReliableWrite_String(client, cmd);
|
||||
}
|
||||
client->prespawn_stage++;
|
||||
}
|
||||
|
||||
//this is extra stuff that will happen after we're on the server
|
||||
|
||||
if (client->prespawn_stage == PRESPAWN_BRUSHES)
|
||||
{ //when brush editing, connecting clients need a copy of all the brushes.
|
||||
while (client->netchan.message.cursize < maxsize)
|
||||
{
|
||||
if (!SV_Prespawn_Brushes(&client->netchan.message, &client->prespawn_idx, &client->prespawn_idx2))
|
||||
{
|
||||
//effectively a cmd spawn... but also causes the client to actually send the player's name too.
|
||||
ClientReliableWrite_Begin (client, svc_signonnum, 2);
|
||||
ClientReliableWrite_Byte (client, 2);
|
||||
client->prespawn_stage++;
|
||||
client->prespawn_idx = 0;
|
||||
client->prespawn_idx2 = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *cmd = va("cmd spawn %i\n",svs.spawncount);
|
||||
ClientReliableWrite_Begin(client, svc_stufftext, 2+strlen(cmd));
|
||||
ClientReliableWrite_String(client, cmd);
|
||||
}
|
||||
client->prespawn_idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1615,7 +1629,7 @@ void SVQW_Spawn_f (void)
|
|||
Con_Printf ("Spawn not valid -- already spawned\n");
|
||||
return;
|
||||
}
|
||||
if (host_client->prespawn_stage != PRESPAWN_DONE)
|
||||
if (host_client->prespawn_stage <= PRESPAWN_SPAWN)
|
||||
{
|
||||
Con_Printf ("%s sent spawn without prespawn!\n", host_client->name);
|
||||
SV_New_f ();
|
||||
|
@ -3497,8 +3511,10 @@ void SV_Say (qboolean team)
|
|||
|
||||
if (*p == '"')
|
||||
{
|
||||
p++;
|
||||
p[Q_strlen(p)-1] = 0;
|
||||
char *e = p + strlen(p)-1;
|
||||
*p++ = 0;
|
||||
if (*e == '\"')
|
||||
*e = 0;
|
||||
}
|
||||
|
||||
if (strlen(text)+strlen(p)+2 >= sizeof(text)-10)
|
||||
|
|
|
@ -1901,11 +1901,10 @@ trace_t World_Move (world_t *w, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t e
|
|||
clip.hitcontentsmask = MASK_POINTSOLID; /*ignores playerclip but hits everything else*/
|
||||
clip.capsule = (passedict->xv->geomtype == GEOMTYPE_CAPSULE);
|
||||
|
||||
if (type & MOVE_ONLYENT)
|
||||
if (type & MOVE_OTHERONLY)
|
||||
{
|
||||
if (!passedict)
|
||||
passedict = w->edicts;
|
||||
return World_ClipMoveToEntity (w, passedict, passedict->v->origin, start, mins, maxs, end, hullnum, type & MOVE_HITMODEL, clip.capsule, clip.hitcontentsmask);
|
||||
wedict_t *other = WEDICT_NUM(w->progs, *w->g.other);
|
||||
return World_ClipMoveToEntity (w, other, other->v->origin, start, mins, maxs, end, hullnum, type & MOVE_HITMODEL, clip.capsule, clip.hitcontentsmask);
|
||||
}
|
||||
|
||||
// clip to world
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue