pmodel command support for Nehahra multiplayer (select skins/models by one number...
[xonotic/darkplaces.git] / host_cmd.c
index f23dc03..d70508e 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);