]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
-Fixed the stupid bug introduced by my NEX_PLAYERMODEL/NEX_PLAYERSKIN commit.
[xonotic/darkplaces.git] / sv_main.c
index c5eb551670839d845b84a776a4ab1bcbaba2a445..afdd8c7965a7843c9c1330e4d78963346999c35c 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -1160,20 +1160,24 @@ void SV_UpdateToReliableMessages (void)
                }
 
                // NEXUIZ_PLAYERMODEL
-               model = PR_GetString(host_client->edict->v->playermodel);
-               if (model == NULL)
-                       model = "";
-               // always point the string back at host_client->name to keep it safe
-               strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
-               host_client->edict->v->playermodel = PR_SetString(host_client->playermodel);
+               if( eval_playermodel ) {
+                       model = PR_GetString(GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string);
+                       if (model == NULL)
+                               model = "";
+                       // always point the string back at host_client->name to keep it safe
+                       strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
+                       GETEDICTFIELDVALUE(host_client->edict, eval_playermodel)->string = PR_SetString(host_client->playermodel);
+               }
 
                // NEXUIZ_PLAYERSKIN
-               skin = PR_GetString(host_client->edict->v->playerskin);
-               if (skin == NULL)
-                       skin = "";
-               // always point the string back at host_client->name to keep it safe
-               strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
-               host_client->edict->v->playerskin = PR_SetString(host_client->playerskin);
+               if( eval_playerskin ) {
+                       skin = PR_GetString(GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string);
+                       if (skin == NULL)
+                               skin = "";
+                       // always point the string back at host_client->name to keep it safe
+                       strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
+                       GETEDICTFIELDVALUE(host_client->edict, eval_playerskin)->string = PR_SetString(host_client->playerskin);
+               }
 
                // frags
                host_client->frags = (int)host_client->edict->v->frags;
@@ -1339,7 +1343,7 @@ int SV_ModelIndex(char *s, int precachemode)
                                if (sv.protocol == PROTOCOL_DARKPLACES6)
                                {
                                        MSG_WriteByte(&sv.reliable_datagram, svc_precache);
-                                       MSG_WriteShort(&sv.reliable_datagram, i + 32768);
+                                       MSG_WriteShort(&sv.reliable_datagram, i);
                                        MSG_WriteString(&sv.reliable_datagram, filename);
                                }
                                return i;