From 36debaea4d051f2bfe8e074fd05fd60bbd9b68f9 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 1 Sep 2018 06:05:51 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5304 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_main.c | 1 - engine/client/client.h | 1 + engine/common/pr_bgcmd.c | 14 +------------- engine/server/sv_user.c | 13 ++++++++----- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index f6edb3db7..996da91a2 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -2063,7 +2063,6 @@ void CL_Color_f (void) #endif } -qboolean CL_CheckDLFile(const char *filename); void CL_PakDownloads(int mode) { /* diff --git a/engine/client/client.h b/engine/client/client.h index f275d8c93..7fd1a376c 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -1280,6 +1280,7 @@ void CLQ2_ParseServerMessage (void); void CL_NewTranslation (int slot); int CL_IsDownloading(const char *localname); +qboolean CL_CheckDLFile(const char *filename); qboolean CL_CheckOrEnqueDownloadFile (const char *filename, const char *localname, unsigned int flags); qboolean CL_EnqueDownload(const char *filename, const char *localname, unsigned int flags); downloadlist_t *CL_DownloadFailed(const char *name, qdownload_t *qdl); diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index 208921869..86a547493 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -2925,22 +2925,10 @@ void QCBUILTIN PF_num_for_edict (pubprogfuncs_t *prinst, struct globalvars_s *pr void QCBUILTIN PF_edict_for_num(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals) { world_t *w = prinst->parms->user; - edict_t *ent; unsigned int num = G_FLOAT(OFS_PARM0); if (num >= w->num_edicts) RETURN_EDICT(prinst, w->edicts); - G_INT(OFS_RETURN) = num; -/* - ent = (edict_t*)EDICT_NUM_PB(prinst, num); - if (!ent) - { - ent = ED_AllocIntoTable(progfuncs, num, false, prinst.fields_size); - ent->ereftype = ER_FREE; - if (externs->entspawn) - externs->entspawn((struct edict_s *) ent, true); - } - - RETURN_EDICT(prinst, ent);*/ + G_INT(OFS_RETURN) = num; //just directly store it. if its not spawned yet we'll need to catch that elsewhere anyway. } /* diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 4afad0746..8ca2112fe 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -1052,11 +1052,13 @@ void SV_SendClientPrespawnInfo(client_t *client) int track = 0; const char *noise = ""; +#ifdef HEXEN2 if (progstype == PROG_H2) { track = sv.h2cdtrack; //hexen2 has a special hack - } - else if (svprogfuncs) + } else +#endif + if (svprogfuncs) { track = ((edict_t*)sv.world.edicts)->v->sounds; noise = PR_GetString(svprogfuncs, ((edict_t*)sv.world.edicts)->v->noise); @@ -1070,9 +1072,10 @@ void SV_SendClientPrespawnInfo(client_t *client) ClientReliableWrite_Byte (client, track); if (ISNQCLIENT(client)) ClientReliableWrite_Byte (client, track); - +#ifdef HEXEN2 if (!track && *sv.h2miditrack) SV_StuffcmdToClient(client, va("music \"%s\"\n", sv.h2miditrack)); +#endif } } else if (client->prespawn_idx == 5) @@ -7597,8 +7600,8 @@ void SV_ReadQCRequest(void) ed = EDICT_NUM_PB(svprogfuncs, e); if (!ed) { - ed = sv.world.edicts; - Con_Printf("client %s sent invalid entity\n", fromclient->name); + ed = (edict_t*)sv.world.edicts; + Con_Printf("client %s sent invalid entity\n", host_client->name); host_client->drop = true; } G_INT(OFS_PARM0+i*3) = EDICT_TO_PROG(svprogfuncs, ed);