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

Modified Files:
	data.c defaults.c feature.c input.c option.c 
Log Message:
Add support for feature packet F_auto_weapons.
Include autoPhaser as netrekrc option.
Only works if server has F_auto_weapons on.

Index: input.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/input.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- input.c	22 May 2009 04:13:17 -0000	1.50
+++ input.c	23 May 2009 13:23:39 -0000	1.51
@@ -1920,8 +1920,6 @@
 phaseraction (W_Event * data)
 {
     unsigned char course;
-
-#if DEBUG
     int x, y;
     register struct player *j;
     struct obtype *gettarget (W_Window ww,
@@ -1930,9 +1928,10 @@
                               int targtype),
     *target;
 
-    if (autoPhaser) /* add range check here */ {
+    if (F_auto_weapons && autoPhaser) {
         target = gettarget (data->Window, data->x, data->y, TARG_ENEMY | TARG_CLOAK);
-        if (target->o_num == -1) { /* failed to find a target */
+        if (target->o_num == -1) { 
+            /* failed to find a target */
             course = (unsigned char) (getcourse (data->Window, data->x, data->y));
             sendPhaserReq (course);
             return;
@@ -1953,7 +1952,6 @@
         course = (unsigned char) (getcourse (data->Window, x, y));
     }
     else
-#endif
         course = (unsigned char) (getcourse (data->Window, data->x, data->y));
     sendPhaserReq (course);
 }

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- data.c	22 May 2009 04:11:21 -0000	1.121
+++ data.c	23 May 2009 13:23:39 -0000	1.122
@@ -769,6 +769,7 @@
 int F_show_visibility_range = 0;
 int F_sp_flags_all = 0;
 int F_why_dead_2 = 0;
+int F_auto_weapons = 0;
 int F_terrain = 0;		/* paradise */
 int F_armies_shipcap = 0;	/* paradise */
 

Index: feature.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/feature.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- feature.c	22 May 2009 04:08:45 -0000	1.28
+++ feature.c	23 May 2009 13:23:39 -0000	1.29
@@ -311,6 +311,7 @@
         F_show_army_count = 1;
         F_show_other_speed = 1;
         F_show_cloakers = 1;
+        F_auto_weapons = 1;
         F_turn_keys = 1;
         F_show_visibility_range = 1;
 #ifdef BEEPLITE

Index: option.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- option.c	22 May 2009 04:08:45 -0000	1.59
+++ option.c	23 May 2009 13:23:39 -0000	1.60
@@ -298,6 +298,7 @@
 struct option Weapons_Menu[] = {
     {0, "Weapons Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
     {1, "Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
+    {1, "use auto aim phasers", &autoPhaser, 0, 0, 0, NULL, NULL},
     {1, "use color weapon bitmaps", &colorWeapons, 0, 0, 0, NULL, NULL},
     {1, "show weapons on galactic", &weaponsOnMap, 0, 0, 0, NULL, NULL},
 #ifdef JUBILEE_PHASERS

Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- defaults.c	22 May 2009 04:08:45 -0000	1.98
+++ defaults.c	23 May 2009 13:23:39 -0000	1.99
@@ -43,6 +43,14 @@
             NULL
         }
     },
+    {"autoPhaser", &autoPhaser, RC_INT,
+        {
+            "Phaser exact location of enemy target closest to cursor",
+            "Enemy must be within phaser range of your ship",
+            "Server god decides whether to enable it on server",
+            NULL
+       }
+    },
     {"autoQuit", &autoQuit, RC_INT,
         {
             "Autoquit timer (default 60)",
@@ -1776,6 +1784,7 @@
     puckArrow = booleanDefault ("puckArrow", puckArrow);
     showArmy = intDefault ("showArmy", showArmy);
     showCloakers = booleanDefault ("showCloakers", showCloakers);
+    autoPhaser = booleanDefault ("autoPhaser", autoPhaser);
     redrawDelay = intDefault ("redrawDelay", redrawDelay);
     planetHighlighting = booleanDefault ("planetHighlighting", planetHighlighting);
     rotatePlanets = booleanDefault ("rotatePlanets", rotatePlanets);