<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39126 >

On 5/12/07, Per Inge Mathisen <[EMAIL PROTECTED]> wrote:
> I do not think the "Explore Nuke" command is not meant to be a goto
> command. You can use the normal goto command for nukes. The cursor
> that appears on "Explore Nuke" is a cosmetic bug. It should just nuke
> at once when this command is given. In 2.1 and up there might be a
> problem using goto properly for nukes, though.

On a second thought, it seems clear that someone thought it should be
implemented this way, and I do not know how long it has been
implemented that way before it was broken. So I committed the patch,
and made the attached patch for 2.1.

  - Per

Index: client/control.c
===================================================================
--- client/control.c	(revision 12931)
+++ client/control.c	(working copy)
@@ -1352,6 +1352,7 @@
   if (can) {
     set_hover_state(punits, HOVER_NUKE, ACTIVITY_LAST, ORDER_LAST);
     update_unit_info_label(punits);
+    enter_goto_state(punits);
   } else {
     create_event(offender, E_BAD_COMMAND,
 		 _("Only nuclear units can do this."));
@@ -1834,7 +1835,7 @@
       if (!possible) {
 	create_event(offender, E_BAD_COMMAND, _("Too far for this unit."));
       } else {
-	do_unit_goto(ptile);
+        do_unit_goto(ptile);
 	if (!pcity) {
 	  unit_list_iterate(punits, punit) {
 	    /* note that this will be executed by the server after the goto */
@@ -1855,6 +1856,7 @@
       do_unit_patrol_to(ptile);
       break;	
     }
+
     set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, ORDER_LAST);
     update_unit_info_label(get_units_in_focus());
   }
@@ -2035,7 +2037,7 @@
 {
   struct tile *dest_tile;
 
-  if (hover_state != HOVER_GOTO) {
+  if (hover_state != HOVER_GOTO && hover_state != HOVER_NUKE) {
     return;
   }
 
@@ -2047,8 +2049,6 @@
     create_event(ptile, E_BAD_COMMAND,
 		 _("Didn't find a route to the destination!"));
   }
-
-  set_hover_state(NULL, HOVER_NONE, ACTIVITY_LAST, ORDER_LAST);
 }
 
 /**************************************************************************
Index: client/goto.c
===================================================================
--- client/goto.c	(revision 12931)
+++ client/goto.c	(working copy)
@@ -752,6 +752,8 @@
 	connect_initial++;
       }
     } /* otherwise moves_left_initially = punit->moves_left (default) */
+  } else if (hover_state == HOVER_NUKE) {
+    parameter->is_pos_dangerous = NULL; /* nuclear safety? pwah! */
   }
 
   if (is_attack_unit(punit) || is_diplomat_unit(punit)) {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to