]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
added DP_CON_SET and DP_CON_SETA extensions
[xonotic/darkplaces.git] / sv_main.c
index 6d9a20b7d3d5123d308f8ff7666ea71b867d4d16..e884eaec71af154292cc324d2e6f036759a60cf5 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -32,6 +32,8 @@ static cvar_t sv_cullentities_trace = {0, "sv_cullentities_trace", "0"}; // tend
 static cvar_t sv_cullentities_stats = {0, "sv_cullentities_stats", "0"};
 static cvar_t sv_entpatch = {0, "sv_entpatch", "1"};
 
+extern cvar_t sys_ticrate;
+
 cvar_t sv_gameplayfix_grenadebouncedownslopes = {0, "sv_gameplayfix_grenadebouncedownslopes", "1"};
 cvar_t sv_gameplayfix_noairborncorpse = {0, "sv_gameplayfix_noairborncorpse", "1"};
 cvar_t sv_gameplayfix_stepdown = {0, "sv_gameplayfix_stepdown", "1"};
@@ -279,7 +281,7 @@ void SV_SendServerinfo (client_t *client)
        char                    message[128];
 
        // edicts get reallocated on level changes, so we need to update it here
-       client->edict = EDICT_NUM(client->number + 1);
+       client->edict = EDICT_NUM((client - svs.clients) + 1);
 
 
        // LordHavoc: clear entityframe tracking
@@ -364,7 +366,6 @@ void SV_ConnectClient (int clientnum, netconn_t *netconnection)
 
        strcpy(client->name, "unconnected");
        strcpy(client->old_name, "unconnected");
-       client->number = clientnum;
        client->spawned = false;
        client->edict = EDICT_NUM(clientnum+1);
        client->message.data = client->msgbuf;
@@ -1137,7 +1138,7 @@ void SV_UpdateToReliableMessages (void)
                        strcpy(host_client->old_name, host_client->name);
                        // send notification to all clients
                        MSG_WriteByte (&sv.reliable_datagram, svc_updatename);
-                       MSG_WriteByte (&sv.reliable_datagram, host_client->number);
+                       MSG_WriteByte (&sv.reliable_datagram, i);
                        MSG_WriteString (&sv.reliable_datagram, host_client->name);
                }
 
@@ -1150,7 +1151,7 @@ void SV_UpdateToReliableMessages (void)
                        host_client->old_colors = host_client->colors;
                        // send notification to all clients
                        MSG_WriteByte (&sv.reliable_datagram, svc_updatecolors);
-                       MSG_WriteByte (&sv.reliable_datagram, host_client->number);
+                       MSG_WriteByte (&sv.reliable_datagram, i);
                        MSG_WriteByte (&sv.reliable_datagram, host_client->colors);
                }
 
@@ -1161,7 +1162,7 @@ void SV_UpdateToReliableMessages (void)
                        host_client->old_frags = host_client->frags;
                        // send notification to all clients
                        MSG_WriteByte (&sv.reliable_datagram, svc_updatefrags);
-                       MSG_WriteByte (&sv.reliable_datagram, host_client->number);
+                       MSG_WriteByte (&sv.reliable_datagram, i);
                        MSG_WriteShort (&sv.reliable_datagram, host_client->frags);
                }
        }