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

I can't see how to logically design a "border editing tool" with
the current or any assumed future border system so here is a patch
that removes it. If I or someone else thinks of a use for this tool
that makes sense, it can of course be easily reinstated.


-----------------------------------------------------------------------
この国境は天命である。

 client/editor.c              |   10 ----------
 client/gui-gtk-2.0/editgui.c |    7 -------
 common/packets.def           |    6 ------
 server/edithand.c            |   34 ----------------------------------
 4 files changed, 0 insertions(+), 57 deletions(-)

diff --git a/client/editor.c b/client/editor.c
index d5b89f8..1f6be9e 100644
--- a/client/editor.c
+++ b/client/editor.c
@@ -177,9 +177,6 @@ void editor_init(void)
             | ETF_HAS_COPY_PASTE, _("Create city.\nShortcut: c"));
   tool_init(ETT_VISION, _("Vision"), ETF_HAS_SIZE,
             _("Modify player's tile knowledge.\nShortcut: v"));
-  tool_init(ETT_TERRITORY, _("Territory"),
-            ETF_HAS_SIZE | ETF_HAS_APPLIED_PLAYER,
-            _("Change tile ownership.\nShortcut: b"));
   tool_init(ETT_STARTPOS, _("Start Position"), ETF_HAS_APPLIED_PLAYER,
             _("Place a player start position.\nShortcut: p"));
 
@@ -861,10 +858,6 @@ void editor_apply_tool(const struct tile *ptile,
     }
     break;
 
-  case ETT_TERRITORY:
-    dsend_packet_edit_territory(my_conn, x, y, erase ? -1 : apno, size);
-    break;
-
   case ETT_STARTPOS:
     dsend_packet_edit_startpos(my_conn, x, y, erase ? -1 : apno);
     break;
@@ -1196,9 +1189,6 @@ struct sprite *editor_tool_get_sprite(enum editor_tool_type ett)
   case ETT_VISION:
     return sprites->vision;
     break;
-  case ETT_TERRITORY:
-    return sprites->territory;
-    break;
   case ETT_STARTPOS:
     return sprites->startpos;
     break;
diff --git a/client/gui-gtk-2.0/editgui.c b/client/gui-gtk-2.0/editgui.c
index 2168cc2..f9d1b55 100644
--- a/client/gui-gtk-2.0/editgui.c
+++ b/client/gui-gtk-2.0/editgui.c
@@ -513,7 +513,6 @@ static struct editbar *editbar_create(void)
   editbar_add_tool_button(eb, ETT_UNIT);
   editbar_add_tool_button(eb, ETT_CITY);
   editbar_add_tool_button(eb, ETT_VISION);
-  editbar_add_tool_button(eb, ETT_TERRITORY);
   editbar_add_tool_button(eb, ETT_STARTPOS);
 
   separator = gtk_vseparator_new();
@@ -1407,9 +1406,6 @@ static GdkPixbuf *get_tool_value_pixbuf(enum editor_tool_type ett,
   case ETT_VISION:
     sprite = sprites->vision;
     break;
-  case ETT_TERRITORY:
-    sprite = sprites->territory;
-    break;
   case ETT_STARTPOS:
     sprite = sprites->startpos;
     break;
@@ -1643,9 +1639,6 @@ gboolean handle_edit_key_press(GdkEventKey *ev)
   case GDK_v:
     new_ett = ETT_VISION;
     break;
-  case GDK_b:
-    new_ett = ETT_TERRITORY;
-    break;
   case GDK_p:
     new_ett = ETT_STARTPOS;
     break;
diff --git a/common/packets.def b/common/packets.def
index 8455fda..300fac4 100644
--- a/common/packets.def
+++ b/common/packets.def
@@ -1471,12 +1471,6 @@ PACKET_EDIT_TILE_BASE=157;cs,handle-per-conn,dsend
   UINT8 size;
 end
 
-PACKET_EDIT_TERRITORY=158;cs,handle-per-conn,dsend
-  COORD x, y; key
-  PLAYER owner; # -1 (or other out of range) for erasing
-  UINT8 size;
-end
-
 PACKET_EDIT_STARTPOS=159;cs,handle-per-conn,dsend
   COORD x, y; key
   NATION nation; # -1 for erase
diff --git a/server/edithand.c b/server/edithand.c
index 3656184..46f0612 100644
--- a/server/edithand.c
+++ b/server/edithand.c
@@ -1194,40 +1194,6 @@ void handle_edit_toggle_fogofwar(struct connection *pc, int plr_no)
 }
 
 /****************************************************************************
-  Change the "ownership" of the tile(s) at the given coordinates.
-****************************************************************************/
-void handle_edit_territory(struct connection *pc, int x, int y, int owner,
-                           int size)
-{
-  struct player *pplayer;
-  struct tile *ptile_center;
-
-  ptile_center = map_pos_to_tile(x, y);
-  if (!ptile_center) {
-    notify_conn(pc->self, NULL, E_BAD_COMMAND,
-                _("Cannot edit territory of tile (%d, %d) because "
-                  "it is not on the map!"), x, y);
-    return;
-  }
-
-  /* NULL is ok; represents "no owner". */
-  pplayer = player_by_number(owner);
-
-  conn_list_do_buffer(game.est_connections);
-  square_iterate(ptile_center, size - 1, ptile) {
-    if (tile_owner(ptile) == pplayer
-        || tile_city(ptile) != NULL) {
-      continue;
-    }
-    /* FIXME: This does not play well with border code
-     * once edit mode is exited. */
-    tile_set_owner(ptile, pplayer);
-    send_tile_info(NULL, ptile, FALSE);
-  } square_iterate_end;
-  conn_list_do_unbuffer(game.est_connections);
-}
-
-/****************************************************************************
   Set the given position to be the start position for the given nation.
 ****************************************************************************/
 void handle_edit_startpos(struct connection *pc, int x, int y,
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to