]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
pmodel command support for Nehahra multiplayer (select skins/models by one number...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Aug 2000 23:27:57 +0000 (23:27 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Aug 2000 23:27:57 +0000 (23:27 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5 d7cf8633-e32d-0410-b094-e92efae38249

chase.c
host_cmd.c
in_null.c [deleted file]
net_bsd.c [deleted file]
nonintel.c [deleted file]
pr_edict.c
progs.h
sv_user.c

diff --git a/chase.c b/chase.c
index 4249881b8aaa72bf553f196898efce0e6771d234..1831a98caca4df5f0c1594a4bfa7e531375e9f3e 100644 (file)
--- a/chase.c
+++ b/chase.c
@@ -47,7 +47,14 @@ void TraceLine (vec3_t start, vec3_t end, vec3_t impact)
        memset (&trace, 0, sizeof(trace));
        SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace);
 
-       VectorCopy (trace.endpos, impact);
+       if (trace.fraction < 1)
+       {
+               VectorCopy (trace.endpos, impact);
+       }
+       else
+       {
+               VectorCopy (end, impact);
+       }
 }
 
 void Chase_Update (void)
index f23dc033e169d160b604636af4a349fa41e11f28..d70508ef5602f99a1c12fa8cefb65816b0818329 100644 (file)
@@ -1637,6 +1637,35 @@ 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 ("usage: pmodel modelnumber\n");
+               return;
+       }
+       i = atoi(Cmd_Argv(1));
+
+       if (cmd_source == src_command)
+       {
+               if (cls.state == ca_connected)
+                       Cmd_ForwardToServer ();
+               return;
+       }
+
+       if (val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel))
+               val->_float = i;
+}
+
 //=============================================================================
 
 /*
@@ -1687,6 +1716,7 @@ 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/in_null.c b/in_null.c
deleted file mode 100644 (file)
index 1c54ee4..0000000
--- a/in_null.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-Copyright (C) 1996-1997 Id Software, Inc.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-
-See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-*/
-// in_null.c -- for systems without a mouse
-
-#include "quakedef.h"
-
-void IN_Init (void)
-{
-}
-
-void IN_Shutdown (void)
-{
-}
-
-void IN_Commands (void)
-{
-}
-
-void IN_Move (usercmd_t *cmd)
-{
-}
-
diff --git a/net_bsd.c b/net_bsd.c
deleted file mode 100644 (file)
index 79d62f8..0000000
--- a/net_bsd.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Copyright (C) 1996-1997 Id Software, Inc.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-
-See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-*/
-#include "quakedef.h"
-
-#include "net_loop.h"
-#include "net_dgrm.h"
-
-net_driver_t net_drivers[MAX_NET_DRIVERS] =
-{
-       {
-       "Loopback",
-       false,
-       Loop_Init,
-       Loop_Listen,
-       Loop_SearchForHosts,
-       Loop_Connect,
-       Loop_CheckNewConnections,
-       Loop_GetMessage,
-       Loop_SendMessage,
-       Loop_SendUnreliableMessage,
-       Loop_CanSendMessage,
-       Loop_CanSendUnreliableMessage,
-       Loop_Close,
-       Loop_Shutdown
-       }
-       ,
-       {
-       "Datagram",
-       false,
-       Datagram_Init,
-       Datagram_Listen,
-       Datagram_SearchForHosts,
-       Datagram_Connect,
-       Datagram_CheckNewConnections,
-       Datagram_GetMessage,
-       Datagram_SendMessage,
-       Datagram_SendUnreliableMessage,
-       Datagram_CanSendMessage,
-       Datagram_CanSendUnreliableMessage,
-       Datagram_Close,
-       Datagram_Shutdown
-       }
-};
-
-int net_numdrivers = 2;
-
-#include "net_udp.h"
-
-net_landriver_t        net_landrivers[MAX_NET_DRIVERS] =
-{
-       {
-       "UDP",
-       false,
-       0,
-       UDP_Init,
-       UDP_Shutdown,
-       UDP_Listen,
-       UDP_OpenSocket,
-       UDP_CloseSocket,
-       UDP_Connect,
-       UDP_CheckNewConnections,
-       UDP_Read,
-       UDP_Write,
-       UDP_Broadcast,
-       UDP_AddrToString,
-       UDP_StringToAddr,
-       UDP_GetSocketAddr,
-       UDP_GetNameFromAddr,
-       UDP_GetAddrFromName,
-       UDP_AddrCompare,
-       UDP_GetSocketPort,
-       UDP_SetSocketPort
-       }
-};
-
-int net_numlandrivers = 1;
diff --git a/nonintel.c b/nonintel.c
deleted file mode 100644 (file)
index e7fc244..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-Copyright (C) 1996-1997 Id Software, Inc.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-
-See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-*/
-//
-// nonintel.c: code for non-Intel processors only
-//
-
-#include "quakedef.h"
-#include "d_local.h"
-
-#if    !id386
-
-/*
-================
-R_Surf8Patch
-================
-*/
-void R_Surf8Patch ()
-{
-       // we only patch code on Intel
-}
-
-
-/*
-================
-R_Surf16Patch
-================
-*/
-void R_Surf16Patch ()
-{
-       // we only patch code on Intel
-}
-
-
-/*
-================
-R_SurfacePatch
-================
-*/
-void R_SurfacePatch (void)
-{
-       // we only patch code on Intel
-}
-
-
-#endif // !id386
-
index f327bac204ebffe4230b9de2d3d6299cfac11877..27ba1355e00add713f9f1aa865b315a79d8690ff 100644 (file)
@@ -108,6 +108,7 @@ int eval_drawonlytoclient;
 int eval_colormod;
 int eval_ping;
 int eval_movement;
+int eval_pmodel;
 
 dfunction_t *SV_PlayerPhysicsQC;
 dfunction_t *EndFrameQC;
@@ -152,6 +153,7 @@ void FindEdictFieldOffsets()
        eval_colormod = FindFieldOffset("colormod");
        eval_ping = FindFieldOffset("ping");
        eval_movement = FindFieldOffset("movement");
+       eval_pmodel = FindFieldOffset("pmodel");
 
        // LordHavoc: allowing QuakeC to override the player movement code
        SV_PlayerPhysicsQC = ED_FindFunction ("SV_PlayerPhysics");
diff --git a/progs.h b/progs.h
index f17adfd3474e6bfaa9405bff0f958ef3eeaca9fe..7bcc6d19d309ccf425300ef31bdc1bf844195b3b 100644 (file)
--- a/progs.h
+++ b/progs.h
@@ -88,6 +88,7 @@ extern int eval_drawonlytoclient;
 extern int eval_colormod;
 extern int eval_ping;
 extern int eval_movement;
+extern int eval_pmodel;
 
 #define GETEDICTFIELDVALUE(ed, fieldoffset) (fieldoffset ? (eval_t*)((char*)&ed->v + fieldoffset) : NULL)
 
index 08b311915b2afc167b40538dcf2a0f1e6ea22e60..303d6ede02cd350bc833e9013f22a820993efd0d 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -570,6 +570,7 @@ nextmsg:
                                 || Q_strncasecmp(s, "kick", 4) == 0
                                 || Q_strncasecmp(s, "ping", 4) == 0
                                 || Q_strncasecmp(s, "ban", 3) == 0
+                                || Q_strncasecmp(s, "pmodel", 6) == 0
                                 || (nehahra && (Q_strncasecmp(s, "max", 3) == 0 || Q_strncasecmp(s, "monster", 7) == 0 || Q_strncasecmp(s, "scrag", 5) == 0 || Q_strncasecmp(s, "gimme", 5) == 0 || Q_strncasecmp(s, "wraith", 6) == 0))
                                 || (!nehahra && (Q_strncasecmp(s, "god", 3) == 0 || Q_strncasecmp(s, "notarget", 8) == 0 || Q_strncasecmp(s, "fly", 3) == 0 || Q_strncasecmp(s, "give", 4) == 0 || Q_strncasecmp(s, "noclip", 6) == 0)))
                                        ret = 1;