]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
implemented PR_GetString and PR_SetString from QWSV source, these work around the...
[xonotic/darkplaces.git] / host_cmd.c
index bd079b0209efb7278ebc24ee5f741d7f6b610af9..25d861c260d3366328daea7b70a0b5c14e5a1cf0 100644 (file)
@@ -567,7 +567,7 @@ void Host_PerformLoadGame(char *name)
        entnum = -1;
        while (!Qeof(f))
        {
-               for (i = 0;i < sizeof(buf) - 1;i++)
+               for (i = 0;i < (int)sizeof(buf) - 1;i++)
                {
                        r = Qgetc (f);
                        if (r == EOF || !r)
@@ -664,7 +664,7 @@ void Host_Name_f (void)
                if (strcmp(host_client->name, newName) != 0)
                        Con_Printf ("%s renamed to %s\n", host_client->name, newName);
        strcpy (host_client->name, newName);
-       host_client->edict->v->netname = host_client->name - pr_strings;
+       host_client->edict->v->netname = PR_SetString(host_client->name);
 
 // send notification to all clients
 
@@ -730,7 +730,7 @@ void Host_Say(qboolean teamonly)
        }
        while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r'))
                p2--;
-       for (j = strlen(text);j < (sizeof(text) - 2) && p1 < p2;)
+       for (j = strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;)
                text[j++] = *p1++;
        text[j++] = '\n';
        text[j++] = 0;
@@ -811,7 +811,7 @@ void Host_Tell_f(void)
        }
        while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r'))
                p2--;
-       for (j = strlen(text);j < (sizeof(text) - 2) && p1 < p2;)
+       for (j = strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;)
                text[j++] = *p1++;
        text[j++] = '\n';
        text[j++] = 0;
@@ -943,11 +943,11 @@ void Host_Pause_f (void)
 
                if (sv.paused)
                {
-                       SV_BroadcastPrintf ("%s paused the game\n", pr_strings + sv_player->v->netname);
+                       SV_BroadcastPrintf ("%s paused the game\n", PR_GetString(sv_player->v->netname));
                }
                else
                {
-                       SV_BroadcastPrintf ("%s unpaused the game\n",pr_strings + sv_player->v->netname);
+                       SV_BroadcastPrintf ("%s unpaused the game\n", PR_GetString(sv_player->v->netname));
                }
 
        // send notification to all clients
@@ -1038,7 +1038,7 @@ void Host_Spawn_f (void)
                memset (ent->v, 0, progs->entityfields * 4);
                ent->v->colormap = NUM_FOR_EDICT(ent);
                ent->v->team = (host_client->colors & 15) + 1;
-               ent->v->netname = host_client->name - pr_strings;
+               ent->v->netname = PR_SetString(host_client->name);
                if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_pmodel)))
                        val->_float = host_client->pmodel;
 
@@ -1403,7 +1403,7 @@ edict_t   *FindViewthing (void)
        for (i=0 ; i<sv.num_edicts ; i++)
        {
                e = EDICT_NUM(i);
-               if ( !strcmp (pr_strings + e->v->classname, "viewthing") )
+               if (!strcmp (PR_GetString(e->v->classname), "viewthing"))
                        return e;
        }
        Con_Printf ("No viewthing on map\n");