From 5aba4ddeaa30c0034951049000a7c4a4a2dbec1f Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 22 Jun 2014 16:30:35 +0000 Subject: [PATCH] fix SV_RunClientCommand on dedicated servers (and other weird ways). fix a couple of other crashes. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4692 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_parse.c | 12 ------------ engine/common/pr_bgcmd.c | 7 +++++-- engine/server/pr_cmds.c | 2 +- engine/server/server.h | 1 + 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index a8929aa27..c1c6ff9b6 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -644,18 +644,6 @@ void CL_DownloadFinished(qdownload_t *dl) COM_RefreshFSCache_f(); - // rename the temp file to it's final name - if (tempname) - { -#ifdef TERRAIN - if (!strncmp(tempname, "temp/", 5) && Terr_DownloadedSection(tempname)) - { - FS_Remove(tempname, dl->fsroot); - return; - } -#endif - } - ext = COM_FileExtension(filename); diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index f55569a4a..67bcb7aac 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -366,7 +366,10 @@ void QCBUILTIN PF_getsurfacenumpoints(pubprogfuncs_t *prinst, struct globalvars_ else { surfnum += model->firstmodelsurface; - G_FLOAT(OFS_RETURN) = model->surfaces[surfnum].mesh->numvertexes; + if (!model->surfaces[surfnum].mesh) + G_FLOAT(OFS_RETURN) = 0; //not loaded properly. + else + G_FLOAT(OFS_RETURN) = model->surfaces[surfnum].mesh->numvertexes; } } // #435 vector(entity e, float s, float n) getsurfacepoint (DP_QC_GETSURFACE) @@ -718,7 +721,7 @@ void QCBUILTIN PF_getsurfacepointattribute(pubprogfuncs_t *prinst, struct global if (model && model->type == mod_brush && surfnum < model->nummodelsurfaces) { surfnum += model->firstmodelsurface; - + if (model->surfaces[surfnum].mesh) if (pointnum < model->surfaces[surfnum].mesh->numvertexes) { switch(attribute) diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 963273abd..4a6ca947c 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -8612,12 +8612,12 @@ static void QCBUILTIN PF_runclientphys(pubprogfuncs_t *prinst, struct globalvars VectorCopy(ent->v->maxs, pmove.player_maxs); VectorCopy(ent->v->mins, pmove.player_mins); + pmove.skipent = -1; pmove.numphysent = 1; pmove.physents[0].model = sv.world.worldmodel; for (i=0 ; i<3 ; i++) { - extern vec3_t pmove_mins, pmove_maxs; pmove_mins[i] = pmove.origin[i] - 256; pmove_maxs[i] = pmove.origin[i] + 256; } diff --git a/engine/server/server.h b/engine/server/server.h index 268156483..3f74c6c0f 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -1398,6 +1398,7 @@ void SV_CheckTimer(void); void SV_LogPlayer(client_t *cl, char *msg); +extern vec3_t pmove_mins, pmove_maxs; //abs min/max extents void AddLinksToPmove ( edict_t *player, areanode_t *node );