Update of /cvsroot/netrek/client/netrekxp/src
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8103

Modified Files:
	ranklist.c socket.c 
Log Message:
SP_RANK, handle case where nranks decreases during gamplay.
Move resize rank window back to ranklist.

Index: ranklist.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/ranklist.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ranklist.c	27 May 2009 10:40:08 -0000	1.9
+++ ranklist.c	29 May 2009 22:05:41 -0000	1.10
@@ -112,9 +112,15 @@
     else
     {
     register int i;
+    static int size = 0;
     char buf[100];
 
-    /* W_ClearWindow(rankw); */
+    if (size != nranks)
+    {
+        W_ClearWindow(rankw);
+        W_ResizeTextWindow(rankw, 80, nranks + 9);
+        size = nranks;
+    }
 
     (void) strcpy (buf, "  Rank       Hours  Offense  Ratings      DI");
     W_WriteText (rankw, 1, 1, textColor, buf, strlen (buf), W_BoldFont);

Index: socket.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- socket.c	28 May 2009 01:19:16 -0000	1.64
+++ socket.c	29 May 2009 22:05:41 -0000	1.65
@@ -2827,9 +2827,8 @@
     {
         ranks = (struct rank *) realloc(ranks, j * sizeof(struct rank));
         memset(&ranks[nranks], 0, (j - nranks) * sizeof(struct rank));
-        nranks = j;
-        W_ResizeTextWindow(rankw, 80, nranks + 9);
     }
+    nranks = j;
     packet->name[15] = 0;
     packet->cname[7] = 0;
     ranks[i].name = strdup(packet->name);