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

Modified Files:
	local.c map.c sound.c 
Log Message:
2 bug fixes for redrawing phasers when player is off galactic coords.
Sound on via sound menu now can initialize sound.

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- local.c	28 Mar 2007 11:17:57 -0000	1.80
+++ local.c	30 Mar 2007 02:50:53 -0000	1.81
@@ -1497,8 +1497,8 @@
                        phaser length to 0. */
                     if (players[php->ph_target].p_x < 0 || players[php->ph_target].p_y < 0)
                     {
-                        tx = WINSIDE / 2;
-                        ty = WINSIDE / 2;
+                        tx = dx;
+                        ty = dy;
                     }
                     else
                     {

Index: map.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/map.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- map.c	28 Mar 2007 11:17:58 -0000	1.36
+++ map.c	30 Mar 2007 02:50:53 -0000	1.37
@@ -1104,7 +1104,8 @@
             /* phasers */
             ph = &phasers[j->p_no];
             if (ph->ph_status != PHFREE &&
-               (j->p_status == PALIVE || j->p_status == PEXPLODE || j->p_status == PDEAD))
+               (j->p_status == PALIVE || j->p_status == PEXPLODE || j->p_status == PDEAD) &&
+               !(j->p_x < 0 || j->p_x >= GWIDTH))
             {
                 switch(ph->ph_status)
                 {

Index: sound.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/sound.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- sound.c	18 Mar 2007 01:46:50 -0000	1.37
+++ sound.c	30 Mar 2007 02:50:53 -0000	1.38
@@ -29,6 +29,7 @@
 
 static void soundrefresh (int i);
 static void Init_sound_flags (void);
+static int init_success = 0;
 
 static Mix_Chunk *sounds[NUM_WAVES];
 static Mix_Music *music[NUM_MUSIC];
@@ -191,6 +192,9 @@
         /* Toggle on sound, and load sound files */
       	sound_toggle = 1;
       	loadSounds();
+      	
+      	/* Keep track of successful sound initialization */
+      	init_success = 1;
 
       	/* Load music files, and play random intro music */
         loadMusic();
@@ -552,7 +556,12 @@
 
     if (i == SOUND_TOGGLE)
     {
-        if (sound_init)
+        if (!init_success)
+        {
+            sound_init = 1;
+            Init_Sound();
+        }
+        else
             sound_toggle = (sound_toggle == 1) ? 0 : 1;
         // Halt all sounds if toggled off
         if (!sound_toggle)