From: lordhavoc Date: Tue, 22 Aug 2000 23:27:57 +0000 (+0000) Subject: pmodel command support for Nehahra multiplayer (select skins/models by one number... X-Git-Tag: RELEASE_0_2_0_RC1~1015 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=1b601105a1d4228358fa0245329cdcb5768c49df pmodel command support for Nehahra multiplayer (select skins/models by one number - hack) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/chase.c b/chase.c index 4249881b..1831a98c 100644 --- 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) diff --git a/host_cmd.c b/host_cmd.c index f23dc033..d70508ef 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -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 index 1c54ee4d..00000000 --- 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 index 79d62f85..00000000 --- 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 index e7fc244e..00000000 --- a/nonintel.c +++ /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 - diff --git a/pr_edict.c b/pr_edict.c index f327bac2..27ba1355 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -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 f17adfd3..7bcc6d19 100644 --- 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) diff --git a/sv_user.c b/sv_user.c index 08b31191..303d6ede 100644 --- 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;