]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
pmodel fixes (now works properly in listen/singleplayer)
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Aug 2000 12:32:44 +0000 (12:32 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 25 Aug 2000 12:32:44 +0000 (12:32 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@14 d7cf8633-e32d-0410-b094-e92efae38249

chase.c
cl_input.c
cl_main.c
host.c
host_cmd.c
server.h

diff --git a/chase.c b/chase.c
index 1831a98caca4df5f0c1594a4bfa7e531375e9f3e..f89a5d66f7bdfd9c0ff30a68819a5ef34fb21628 100644 (file)
--- 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)
index 305bc226f331b0ae545c046bc89026ab28d2eaa9..a4a7e4d2aaf4802e6ddabdc436772bfb84946f83 100644 (file)
@@ -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
index 0a9d3879f1348699ae76162408a8ed4291ca93e7..af1b4a0437e1feb7b6909bf306b4fe4904a4b812 100644 (file)
--- 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 416d4be0f696b39d95c5d84f1b24a8d6fd88e48e..2c3bcd46ec3681d5c38fc497fe66c2019890c3ef 100644 (file)
--- 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;
index 48149b1a09317631615adb57cdccf268b090b5bd..97372b39ed0624ebd1f6c7275969cb4336a9b543 100644 (file)
@@ -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);
index 4e6635f8110951842b33d2dc7c02eacaadb9c326..9120cdcee9362188e45506ed0a204834803d635b 100644 (file)
--- 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;