Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#13186) remove draw_goto_line conditional
Home

[Freeciv-Dev] (PR#13186) remove draw_goto_line conditional

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13186) remove draw_goto_line conditional
From: "Jason Dorje Short" <jdorje@xxxxxxxxx>
Date: Sat, 28 May 2005 15:00:09 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch removes the draw_goto_line condition in client goto.

Previously this value could be set to FALSE for air goto.  These
wouldn't use client-side goto but would instead use server goto.
However for a while now this has been unused so this value is always
TRUE.  Thus we can simply remove it.

As a side note this was almost the only user of server-side goto in the
client.  So after this it's trivial to remove server goto.  But that's
for another patch...

-jason

Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.176
diff -u -r1.176 control.c
--- client/control.c    26 May 2005 04:55:18 -0000      1.176
+++ client/control.c    28 May 2005 21:57:59 -0000
@@ -59,9 +59,6 @@
 enum cursor_hover_state hover_state = HOVER_NONE;
 enum unit_activity connect_activity;
 enum unit_orders goto_last_order; /* Last order for goto */
-/* This may only be here until client goto is fully implemented.
-   It is reset each time the hower_state is reset. */
-bool draw_goto_line = TRUE;
 
 /* units involved in current combat */
 static struct unit *punit_attacking = NULL;
@@ -115,7 +112,6 @@
   assert(punit != NULL || state == HOVER_NONE);
   assert(state == HOVER_CONNECT || activity == ACTIVITY_LAST);
   assert(state == HOVER_GOTO || order == ORDER_LAST);
-  draw_goto_line = TRUE;
   if (punit)
     hover_unit = punit->id;
   else
@@ -1690,18 +1686,14 @@
     return;
 
   if (punit) {
-    if (!draw_goto_line) {
-      send_goto_unit(punit, ptile);
-    } else {
-      struct tile *dest_tile;
+    struct tile *dest_tile;
 
-      draw_line(ptile);
-      dest_tile = get_line_dest();
-      if (ptile == dest_tile) {
-       send_goto_route(punit);
-      } else {
-       append_output_window(_("Didn't find a route to the destination!"));
-      }
+    draw_line(ptile);
+    dest_tile = get_line_dest();
+    if (ptile == dest_tile) {
+      send_goto_route(punit);
+    } else {
+      append_output_window(_("Didn't find a route to the destination!"));
     }
   }
 
@@ -1777,9 +1769,9 @@
 
   cancel_tile_hiliting();
 
-  if (hover_state == HOVER_GOTO || hover_state == HOVER_PATROL)
-    if (draw_goto_line)
-      popped = goto_pop_waypoint();
+  if (hover_state == HOVER_GOTO || hover_state == HOVER_PATROL) {
+    popped = goto_pop_waypoint();
+  }
 
   if (hover_state != HOVER_NONE && !popped) {
     struct unit *punit = player_find_unit_by_id(game.player_ptr, hover_unit);
Index: client/control.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.h,v
retrieving revision 1.50
diff -u -r1.50 control.h
--- client/control.h    26 Apr 2005 19:58:24 -0000      1.50
+++ client/control.h    28 May 2005 21:57:59 -0000
@@ -36,7 +36,6 @@
 extern enum cursor_hover_state hover_state;
 extern enum unit_activity connect_activity;
 extern enum unit_orders goto_last_order;
-extern bool draw_goto_line;
 extern bool non_ai_unit_focus;
 
 bool can_unit_do_connect(struct unit *punit, enum unit_activity activity);
Index: client/mapctrl_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapctrl_common.c,v
retrieving revision 1.54
diff -u -r1.54 mapctrl_common.c
--- client/mapctrl_common.c     5 May 2005 18:32:46 -0000       1.54
+++ client/mapctrl_common.c     28 May 2005 21:57:59 -0000
@@ -606,10 +606,9 @@
 **************************************************************************/
 void update_line(int canvas_x, int canvas_y)
 {
-  if ((hover_state == HOVER_GOTO
-       || hover_state == HOVER_PATROL
-       || hover_state == HOVER_CONNECT)
-      && draw_goto_line) {
+  if (hover_state == HOVER_GOTO
+      || hover_state == HOVER_PATROL
+      || hover_state == HOVER_CONNECT) {
     struct tile *ptile, *old_tile;
 
     ptile = canvas_pos_to_tile(canvas_x, canvas_y);
@@ -629,10 +628,9 @@
 ****************************************************************************/
 void overview_update_line(int overview_x, int overview_y)
 {
-  if ((hover_state == HOVER_GOTO
-       || hover_state == HOVER_PATROL
-       || hover_state == HOVER_CONNECT)
-      && draw_goto_line) {
+  if (hover_state == HOVER_GOTO
+      || hover_state == HOVER_PATROL
+      || hover_state == HOVER_CONNECT) {
     struct tile *ptile, *old_tile;
     int x, y;
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13186) remove draw_goto_line conditional, Jason Dorje Short <=