From: lordhavoc Date: Fri, 25 Aug 2000 12:32:44 +0000 (+0000) Subject: pmodel fixes (now works properly in listen/singleplayer) X-Git-Tag: RELEASE_0_2_0_RC1~1006 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=590a07608279a8a21604a83620d77abe9c731796;p=xonotic%2Fdarkplaces.git pmodel fixes (now works properly in listen/singleplayer) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@14 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/chase.c b/chase.c index 1831a98c..f89a5d66 100644 --- a/chase.c +++ b/chase.c @@ -42,19 +42,15 @@ qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec void TraceLine (vec3_t start, vec3_t end, vec3_t impact) { + /* trace_t trace; memset (&trace, 0, sizeof(trace)); SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace); - if (trace.fraction < 1) - { - VectorCopy (trace.endpos, impact); - } - else - { - VectorCopy (end, impact); - } + VectorCopy (trace.endpos, impact); + */ + VectorCopy (end, impact); } void Chase_Update (void) diff --git a/cl_input.c b/cl_input.c index 305bc226..a4a7e4d2 100644 --- a/cl_input.c +++ b/cl_input.c @@ -351,7 +351,7 @@ void CL_SendMove (usercmd_t *cmd) upmove += cmd->upmove; total++; // LordHavoc: cap outgoing movement messages to sys_ticrate - if (realtime - lastmovetime < sys_ticrate.value) + if (cl.maxclients > 1 && realtime - lastmovetime < sys_ticrate.value) return; lastmovetime = realtime; // average what has happened during this time diff --git a/cl_main.c b/cl_main.c index 0a9d3879..af1b4a04 100644 --- a/cl_main.c +++ b/cl_main.c @@ -199,18 +199,18 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon); break; case 2: - if (cl_pmodel.value) - { - MSG_WriteByte (&cls.message, clc_stringcmd); - MSG_WriteString (&cls.message, va("pmodel %f\n", cl_pmodel.value)); - } - MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string)); MSG_WriteByte (&cls.message, clc_stringcmd); MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color.value)>>4, ((int)cl_color.value)&15)); + if (cl_pmodel.value) + { + MSG_WriteByte (&cls.message, clc_stringcmd); + MSG_WriteString (&cls.message, va("pmodel %f\n", cl_pmodel.value)); + } + MSG_WriteByte (&cls.message, clc_stringcmd); sprintf (str, "spawn %s", cls.spawnparms); MSG_WriteString (&cls.message, str); @@ -779,6 +779,39 @@ void CL_PauseDemo_f (void) Con_Printf("Demo unpaused\n"); } +/* +====================== +CL_PModel_f +LordHavoc: Intended for Nehahra, I personally think this is dumb, but Mindcrime won't listen. +====================== +*/ +void CL_PModel_f (void) +{ + int i; + eval_t *val; + + if (Cmd_Argc () == 1) + { + Con_Printf ("\"pmodel\" is \"%s\"\n", cl_pmodel.string); + return; + } + i = atoi(Cmd_Argv(1)); + + if (cmd_source == src_command) + { + if (cl_pmodel.value == i) + return; + Cvar_SetValue ("_cl_pmodel", i); + if (cls.state == ca_connected) + Cmd_ForwardToServer (); + return; + } + + host_client->pmodel = i; + if (val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel)) + val->_float = i; +} + cvar_t demo_nehahra = {"demo_nehahra", "0"}; /* @@ -829,6 +862,8 @@ void CL_Init (void) // LordHavoc: added pausedemo Cmd_AddCommand ("pausedemo", CL_PauseDemo_f); + // LordHavoc: added pmodel command (like name, etc, only intended for Nehahra) + Cmd_AddCommand ("pmodel", CL_PModel_f); // LordHavoc: added demo_nehahra cvar Cvar_RegisterVariable (&demo_nehahra); if (nehahra) diff --git a/host.c b/host.c index 416d4be0..2c3bcd46 100644 --- a/host.c +++ b/host.c @@ -618,7 +618,7 @@ void Host_ServerFrame (void) { frametimetotal += host_frametime; // LordHavoc: cap server at sys_ticrate in listen games - if (!isDedicated && ((realtime - lastservertime) < sys_ticrate.value)) + if (!isDedicated && svs.maxclients > 1 && ((realtime - lastservertime) < sys_ticrate.value)) return; // run the world state pr_global_struct->frametime = frametimetotal; diff --git a/host_cmd.c b/host_cmd.c index 48149b1a..97372b39 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -1073,6 +1073,7 @@ void Host_Spawn_f (void) } else { + eval_t *val; // set up the edict ent = host_client->edict; @@ -1080,6 +1081,8 @@ void Host_Spawn_f (void) ent->v.colormap = NUM_FOR_EDICT(ent); ent->v.team = (host_client->colors & 15) + 1; ent->v.netname = host_client->name - pr_strings; + if (val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel)) + val->_float = host_client->pmodel; // copy spawn parms out of the client_t @@ -1637,38 +1640,6 @@ void Host_Stopdemo_f (void) CL_Disconnect (); } -/* -====================== -Host_PModel_f -LordHavoc: Intended for Nehahra, I personally think this is dumb, but Mindcrime won't listen. -====================== -*/ -void Host_PModel_f (void) -{ - int i; - eval_t *val; - - if (Cmd_Argc () == 1) - { - Con_Printf ("\"pmodel\" is \"%s\"\n", cl_pmodel.string); - return; - } - i = atoi(Cmd_Argv(1)); - - if (cmd_source == src_command) - { - if (cl_pmodel.value == i) - return; - Cvar_SetValue ("_cl_pmodel", i); - if (cls.state == ca_connected) - Cmd_ForwardToServer (); - return; - } - - if (val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel)) - val->_float = i; -} - //============================================================================= /* @@ -1719,7 +1690,6 @@ void Host_InitCommands (void) Cmd_AddCommand ("ping", Host_Ping_f); Cmd_AddCommand ("load", Host_Loadgame_f); Cmd_AddCommand ("save", Host_Savegame_f); - Cmd_AddCommand ("pmodel", Host_PModel_f); Cmd_AddCommand ("startdemos", Host_Startdemos_f); Cmd_AddCommand ("demos", Host_Demos_f); diff --git a/server.h b/server.h index 4e6635f8..9120cdce 100644 --- a/server.h +++ b/server.h @@ -103,6 +103,7 @@ typedef struct client_s // client known data for deltas int old_frags; + int pmodel; } client_t;