Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs16:/tmp/cvs-serv16280/src

Modified Files:
	distress.c map.c mswindow.c short.c 
Log Message:
Fixed bug with RCM kill messages where size of kill field was exceeded if kills
were greater than 255.
Sanity checks on netrekrc window geometries for local and map window.
View range circle no longer shows if you are in base (it's not useful in that
ship).

Index: short.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- short.c	6 Apr 2007 06:46:32 -0000	1.21
+++ short.c	8 Apr 2007 22:36:42 -0000	1.22
@@ -1510,7 +1510,17 @@
             dist.sender = victim;
             dist.tclose_j = killer;
             dist.arms = armies;
-            dist.dam = (unsigned char) (damage / 100);
+            /* Kills > 255 need to be stuffed into another field */
+            if (damage > 25500)
+            {
+                dist.dam = (unsigned char) (255);
+                dist.etmp = (unsigned char) ((damage - 25500) / 100);
+            }
+            else
+            {
+                dist.dam = (unsigned char) (damage / 100);
+                dist.etmp = 0;
+            }
             dist.shld = (unsigned char) (damage % 100);
             dist.wtmp = (unsigned char) karg5;
             makedistress (&dist, msg.mesg, rcm_msg[1].macro);
@@ -1735,7 +1745,17 @@
             dist.sender = packet->argument;
             dist.tclose_j = packet->argument;
             dist.arms = '\0';
-            dist.dam = (unsigned char) (damage / 100);
+            /* Kills > 255 need to be stuffed into another field */
+            if (damage > 25500)
+            {
+                dist.dam = (unsigned char) (255);
+                dist.etmp = (unsigned char) ((damage - 25500) / 100);
+            }
+            else
+            {
+                dist.dam = (unsigned char) (damage / 100);
+                dist.etmp = 0;
+            }
             dist.shld = (unsigned char) (damage % 100);
             dist.wtmp = (unsigned char) karg5;
             makedistress (&dist, msg.mesg, rcm_msg[6].macro);

Index: distress.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/distress.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- distress.c	15 Aug 2006 07:18:31 -0000	1.5
+++ distress.c	8 Apr 2007 22:36:41 -0000	1.6
@@ -797,7 +797,7 @@
 #ifdef RCM
                 if (dist->distype == rcm)
                 {
-                    APPEND_INT (pbuf1, dist->dam);
+                    APPEND_INT (pbuf1, dist->dam + dist->etmp);
                     *pbuf1++ = '.';
                     itoapad (dist->shld, pbuf1, 1, 2);
                     pbuf1 += 2;

Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- mswindow.c	7 Apr 2007 09:16:14 -0000	1.57
+++ mswindow.c	8 Apr 2007 22:36:41 -0000	1.58
@@ -4840,9 +4840,18 @@
             s++;
         *width = atoi (geom_default);
         if (!strcmp("local", name))
+        {
             TWINSIDE = *width;
+            /* Sanity checks .. */
+            if (TWINSIDE > 5000)
+                TWINSIDE = 5000;
+        }
         else if (!strcmp("map", name))
+        {
             GWINSIDE = *width;
+            if (GWINSIDE > 5000)
+                GWINSIDE = 5000;
+        }
         result |= G_SET_WIDTH;
         if (*s == 0)
             return result;
@@ -4857,6 +4866,8 @@
             {
                 *width = *height;
                 TWINSIDE = *height;
+                if (TWINSIDE > 5000)
+                    TWINSIDE = 5000;
             }
         }
         else if (!strcmp("map", name))
@@ -4865,6 +4876,8 @@
             {
                 *width = *height;
                 GWINSIDE = *height;
+                if (GWINSIDE > 5000)
+                    GWINSIDE = 5000;
             }
         }
         result |= G_SET_HEIGHT;

Index: map.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- map.c	7 Apr 2007 11:35:27 -0000	1.45
+++ map.c	8 Apr 2007 22:36:41 -0000	1.46
@@ -1111,7 +1111,8 @@
 #endif
 
 	/* Draw range circle */
-	if (viewRange && (myPlayer(j) || isObsLockPlayer(j)))
+	if (viewRange && (myPlayer(j) || isObsLockPlayer(j))
+	    && j->p_ship.s_type != STARBASE)
         {
           /* Orbitting any non-owned planet gets you seen,
              so don't draw the circle */