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

Modified Files:
	data.c local.c 
Log Message:
More bugs on paradise todo list.
Addition of 3rd metaserver.
Fix to cloak bug where ships would briefly be seen to flash when entering
tactical range.  Was introduced when cloaking sounds were added to
all ships.

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- local.c	16 Jul 2007 23:44:18 -0000	1.107
+++ local.c	29 Nov 2007 05:29:06 -0000	1.108
@@ -885,28 +885,24 @@
             if (!(j->p_flags & PFCLOAK))
                 continue;
         }
-        
+
+        cloak_phases = CLOAK_PHASES * server_ups / 10;
         dx = j->p_x - me->p_x;
         dy = j->p_y - me->p_y;
-        if (dx > view || dx < -view || dy > view || dy < -view)
-            continue;
 
-        dx = dx / scaleFactor + TWINSIDE / 2;
-        dy = dy / scaleFactor + TWINSIDE / 2;
-
-        cloak_phases = CLOAK_PHASES * server_ups / 10;
         if (j->p_flags & PFCLOAK)
         {
             if (j->p_cloakphase < (cloak_phases - 1))
             {
 
 #ifdef SOUND
-                if (j->p_cloakphase == 0)
+                /* Only play sounds for ships on tactical */
+                if (j->p_cloakphase == 0 && dx <= view && dx >= -view && dy <= view && dy >= -view)
                 {
                     // To avoid hearing twarp cloak sounds as the twarper/observer
                     if ( (myPlayer(j) || isObsLockPlayer(j)) ? ((me->p_flags & PFTWARP) ? 0 : 1) : 1 )
                     {
-                    	SetDistAngle(dx, dy);   
+                    	SetDistAngle(dx / scaleFactor + TWINSIDE / 2, dy / scaleFactor + TWINSIDE / 2);   
                         // At short distances, don't use angular sound
                         if (!soundAngles || distance < SCALE/2)
                             Play_Sound_Loc(CLOAKED_WAV, SF_CLOAKING, -1, distance);
@@ -928,9 +924,10 @@
                 // To avoid twarp cloak sounds as the twarper/observer
                 if ( (myPlayer(j) || isObsLockPlayer(j)) ? ((me->p_flags & PFTWARP) ? 0 : 1) : 1 )
                 {
-                    if (j->p_cloakphase == cloak_phases - 1)
+                    /* Only play sounds for ships on tactical */
+                    if (j->p_cloakphase == (cloak_phases - 1) && dx <= view && dx >= -view && dy <= view && dy >= -view)
                     {
-                        SetDistAngle(dx, dy);
+                        SetDistAngle(dx / scaleFactor + TWINSIDE / 2, dy / scaleFactor + TWINSIDE / 2);
                         // At short distances, don't use angular sound
                         if (!soundAngles || distance < SCALE/2)
                             Play_Sound_Loc(UNCLOAK_WAV, SF_CLOAKING, -1, distance);
@@ -946,6 +943,12 @@
             }
         }
 
+        if (dx > view || dx < -view || dy > view || dy < -view)
+            continue;
+
+        dx = dx / scaleFactor + TWINSIDE / 2;
+        dy = dy / scaleFactor + TWINSIDE / 2;
+
         /* If cloaking cycle is complete, just draw the cloak icon, and skip over
            the ship drawing code with the goto statement */
         if (j->p_flags & PFCLOAK && (j->p_cloakphase == (cloak_phases - 1)))

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- data.c	29 Jul 2007 01:38:41 -0000	1.100
+++ data.c	29 Nov 2007 05:29:05 -0000	1.101
@@ -254,7 +254,7 @@
 
 #ifdef META
 /* Metaservers list - comma delimited  */
-char *metaServer = "metaserver.us.netrek.org, metaserver2.us.netrek.org";
+char *metaServer = "metaserver.us.netrek.org, metaserver2.us.netrek.org, metaserver3.us.netrek.org";
 int metaPort = 3521;
 int metaVerbose = 0;
 char *metaCache = NULL;