Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv23244/src

Modified Files:
	cowmain.c data.c input.c local.c map.c short.c spopt.c 
Log Message:
Heading tic default to off for the places I missed (whoops).
Changed to format of sendShortReq, now passes a 2nd argument which
tells whether to display the warning message confirming the packet
request was sent.
More bug fixes for phasers and checking against out of bounds.
Added a quiet request for small update if you are alive, but out of galactic
bounds.  At high packet loss, it's not uncommon to lose your ship position
packet upon reentry into game.  And since your position is not resent
until you move, it was causing draw problems (in fact local window wasn't
redrawing at all because client thought you were out of bounds).  This
will probably mitigate problems with alert borders not updating on death and
stray weapons on map, more testing needed however.

Index: input.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- input.c	16 Mar 2007 17:24:16 -0000	1.29
+++ input.c	1 Apr 2007 10:11:37 -0000	1.30
@@ -2336,7 +2336,7 @@
 Key45 (void)
 {
 #ifdef SHORT_PACKETS
-    sendShortReq (SPK_SALL);
+    sendShortReq (SPK_SALL, 1);
 #endif
 
 }
@@ -3456,7 +3456,7 @@
 {
 
 #ifdef SHORT_PACKETS
-    sendShortReq (SPK_ALL);
+    sendShortReq (SPK_ALL, 1);
 #endif
 
 }

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- local.c	30 Mar 2007 02:50:53 -0000	1.81
+++ local.c	1 Apr 2007 10:11:37 -0000	1.82
@@ -1495,7 +1495,7 @@
                        and your target's ship is no longer visible to your team.
                        Best solution seems to be to not draw the phaser by setting
                        phaser length to 0. */
-                    if (players[php->ph_target].p_x < 0 || players[php->ph_target].p_y < 0)
+                    if (players[php->ph_target].p_x < 0 || players[php->ph_target].p_x > GWIDTH)
                     {
                         tx = dx;
                         ty = dy;
@@ -2607,9 +2607,17 @@
 
     /* Keep redrawing for double buffered observers who get set out of normal gameplay bounds,
        whether due to locking onto an ineligible planet, or observing a player who dies -
-       otherwise screen doesn't refresh*/
+       otherwise screen doesn't refresh */
     if ((me->p_x < 0 || me->p_x >= GWIDTH) && !(doubleBuffering && (me->p_flags & PFOBSERV)))
+    {
+        /* If alive but out of bounds, we probably missed a packet giving our location,
+           so quietly request a new one */
+#ifdef SHORT_PACKETS
+        if (me->p_status == PALIVE) 
+            sendShortReq (SPK_SALL, 0);
+#endif
         return;
+    }
 
     DrawPlanets ();
 

Index: short.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/short.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- short.c	14 Mar 2007 18:36:08 -0000	1.17
+++ short.c	1 Apr 2007 10:11:37 -0000	1.18
@@ -204,7 +204,6 @@
 #define NUMVARITEXTS ( sizeof vari_texts / sizeof   vari_texts[0])
 #define NUMDAEMONTEXTS ( sizeof daemon_texts / sizeof daemon_texts[0])
 
-extern void sendShortReq (char);
 void new_flags (unsigned int data,
                 int which);
 
@@ -910,7 +909,7 @@
         {                       /* retry for S_P 1 */
             LineToConsole ("Using Short Packet Version 1.\n");
             shortversion = OLDSHORTVERSION;
-            sendShortReq (SPK_VON);
+            sendShortReq (SPK_VON, 1);
         }
         else
         {
@@ -936,7 +935,7 @@
          * when you first enter and to fix other loss if short packets
          * have just been turned back on.
          */
-        sendShortReq (SPK_SALL);
+        sendShortReq (SPK_SALL, 1);
         break;
     case SPK_MOFF:
         recv_mesg = 0;
@@ -1226,7 +1225,7 @@
 
 
 void
-sendShortReq (char state)
+sendShortReq (char state, int showmess)
 {
     struct shortreq_cpacket shortReq;
 
@@ -1250,13 +1249,15 @@
         /* Let the client do the work, and not the network :-) */
 
         resetWeaponInfo ();
-
-        if (state == SPK_SALL)
-            warning ("Sent request for small update (weapons+planets+kills)");
-        else if (state == SPK_ALL)
-            warning ("Sent request for medium update (all except stats)");
-        else
-            warning ("Sent some unknown request...");
+        if (showmess)
+        {
+            if (state == SPK_SALL)
+                warning ("Sent request for small update (weapons+planets+kills)");
+            else if (state == SPK_ALL)
+                warning ("Sent request for medium update (all except stats)");
+            else
+                warning ("Sent some unknown request...");
+        }
     }
 
     sendServerPacket ((struct player_spacket *) &shortReq);

Index: spopt.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/spopt.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- spopt.c	12 Apr 2006 04:20:04 -0000	1.2
+++ spopt.c	1 Apr 2007 10:11:37 -0000	1.3
@@ -86,9 +86,9 @@
         if (data->type == W_EV_BUTTON)
         {
             if (recv_short)
-                sendShortReq (SPK_VOFF);
+                sendShortReq (SPK_VOFF, 1);
             else
-                sendShortReq (SPK_VON);
+                sendShortReq (SPK_VON, 1);
         }
         break;
 
@@ -96,9 +96,9 @@
         if (data->type == W_EV_BUTTON)
         {
             if (recv_mesg)
-                sendShortReq (SPK_MOFF);
+                sendShortReq (SPK_MOFF, 1);
             else
-                sendShortReq (SPK_MON);
+                sendShortReq (SPK_MON, 1);
         }
         break;
 
@@ -106,9 +106,9 @@
         if (data->type == W_EV_BUTTON)
         {
             if (recv_kmesg)
-                sendShortReq (SPK_M_NOKILLS);
+                sendShortReq (SPK_M_NOKILLS, 1);
             else
-                sendShortReq (SPK_M_KILLS);
+                sendShortReq (SPK_M_KILLS, 1);
         }
         break;
 
@@ -116,9 +116,9 @@
         if (data->type == W_EV_BUTTON)
         {
             if (recv_warn)
-                sendShortReq (SPK_M_NOWARN);
+                sendShortReq (SPK_M_NOWARN, 1);
             else
-                sendShortReq (SPK_M_WARN);
+                sendShortReq (SPK_M_WARN, 1);
         }
         break;
 

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- data.c	25 Mar 2007 23:44:37 -0000	1.72
+++ data.c	1 Apr 2007 10:11:37 -0000	1.73
@@ -814,7 +814,7 @@
 int useFullShipInfo = 1;	/* Prefer SP_PLAYER packets over SP_S_PLAYER packets */
 int useFullWeapInfo = 1;	/* Receive larger torp packets, get self torp info beyond
 				   tactical, allow observer to see all weapons fire */
-int headingTic = 1;		/* show ship heading tic */
+int headingTic = 0;		/* show ship heading tic */
 int tractorID = 1;		/* show ID of player you are tractoring */
 int lockLine = 1;		/* draw dashed line on map from you to lock target */
 int weaponsOnMap = 1;		/* draw weapons fire on map */

Index: cowmain.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cowmain.c	13 Mar 2007 18:35:00 -0000	1.29
+++ cowmain.c	1 Apr 2007 10:11:36 -0000	1.30
@@ -1040,7 +1040,7 @@
 #ifdef SHORT_PACKETS            /* should we be checking for
                                  * udp on here? */
         if (tryShort)
-            sendShortReq (SPK_VON);
+            sendShortReq (SPK_VON, 1);
         else
         {
             /*

Index: map.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- map.c	30 Mar 2007 02:50:53 -0000	1.37
+++ map.c	1 Apr 2007 10:11:37 -0000	1.38
@@ -1105,7 +1105,7 @@
             ph = &phasers[j->p_no];
             if (ph->ph_status != PHFREE &&
                (j->p_status == PALIVE || j->p_status == PEXPLODE || j->p_status == PDEAD) &&
-               !(j->p_x < 0 || j->p_x >= GWIDTH))
+               !(j->p_x < 0 || j->p_x > GWIDTH))
             {
                 switch(ph->ph_status)
                 {
@@ -1122,7 +1122,7 @@
                         break;
                     default:
                         /* Don't draw phasers to ships out of galactic bounds */
-                        if (players[ph->ph_target].p_x < 0 || players[ph->ph_target].p_y < 0)
+                        if (players[ph->ph_target].p_x < 0 || players[ph->ph_target].p_x > GWIDTH)
                         {
                             tx = dx;
                             ty = dy;