[Freeciv-Dev] (PR#40439) [patch] fix absolute path detection on Windows
http://bugs.freeciv.org/Ticket/Display.html?id=40439 > Absolute paths aren't detected on Windows, which prevents saving games in other directories than the default directory. Reported on the forums: http://forum.freeciv.org/viewtopic.php?t=5541 Index: utility/shared.c === --- utility/shared.c (revision 15137) +++ utility/shared.c (working copy) @@ -1688,9 +1688,15 @@ return FALSE; } +#ifdef WIN32_NATIVE + if (strchr(filename, ':')) { +return TRUE; + } +#else if (filename[0] == '/') { return TRUE; } +#endif return FALSE; } ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40440) [Patch] Fix tile info popup list of buildings
http://bugs.freeciv.org/Ticket/Display.html?id=40440 > If there is just one visible building in a city, tile popup does not show it. Fix attached. - ML diff -Nurd -X.diff_ignore freeciv/client/text.c freeciv/client/text.c --- freeciv/client/text.c 2008-08-15 16:14:29.0 +0300 +++ freeciv/client/text.c 2008-08-15 23:32:37.0 +0300 @@ -181,27 +181,25 @@ improvement_iterate(pimprove) { if (is_improvement_visible(pimprove) && city_has_building(pcity, pimprove)) { -if (NULL != prev_impr) { - if (has_improvements++ > 0) { -/* TRANS: continue list, in case comma is not the separator of choice. */ -astr_add(&str, Q_("?clistmore:, %s"), -improvement_name_translation(prev_impr)); - } else { - /* TRANS: previous lines gave other information about the city. */ -astr_add(&str, Q_("?clistbegin: with %s"), -improvement_name_translation(prev_impr)); - } +if (has_improvements++ > 1) { + /* TRANS: continue list, in case comma is not the separator of choice. */ + astr_add(&str, Q_("?clistmore:, %s"), + improvement_name_translation(prev_impr)); +} else if (has_improvements == 1) { + /* TRANS: previous lines gave other information about the city. */ + astr_add(&str, Q_("?clistbegin: with %s"), + improvement_name_translation(pimprove)); } prev_impr = pimprove; } } improvement_iterate_end; if (NULL != prev_impr) { - if (has_improvements > 1) { + if (has_improvements > 2) { /* TRANS: This appears with two or more previous entries in the list */ astr_add(&str, Q_("?clistlast:, and %s"), improvement_name_translation(prev_impr)); - } else if (has_improvements > 0) { + } else if (has_improvements > 1) { /* TRANS: This appears with only one previous entry in the list */ astr_add(&str, Q_("?clistlast: and %s"), improvement_name_translation(prev_impr)); ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40441) [Patch] Military bases out of specials
http://bugs.freeciv.org/Ticket/Display.html?id=40441 > This patch implements handling of military bases independently from specials. Old base bits left to specials array to maintain savegame backward compatibility. While testing this I noticed that current S2_2 does not save bases at all. - ML Bases.diff.bz2 Description: BZip2 compressed data ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40442) [Patch] Better unit remove tool
http://bugs.freeciv.org/Ticket/Display.html?id=40442 > Attached patch improves the unit tool under erase mode to erase only units of the selected unit type (value erase) belonging to the current 'applied player' a number of times equal to the value of the 'count' parameter. --- 昨晩、私の押入れをきれいにした。 diff --git a/client/editor.c b/client/editor.c index cbbd3b6..8f16676 100644 --- a/client/editor.c +++ b/client/editor.c @@ -118,8 +118,8 @@ void editor_init(void) SET_TOOL(ETT_MILITARY_BASE, _("Military Base"), ETF_HAS_VALUE | ETF_HAS_SIZE | ETF_HAS_VALUE_ERASE, _("Create a military base.")); - SET_TOOL(ETT_UNIT, _("Unit"), - ETF_HAS_VALUE | ETF_HAS_COUNT | ETF_HAS_APPLIED_PLAYER, + SET_TOOL(ETT_UNIT, _("Unit"), ETF_HAS_VALUE | ETF_HAS_COUNT + | ETF_HAS_APPLIED_PLAYER | ETF_HAS_VALUE_ERASE, _("Create unit.")); SET_TOOL(ETT_CITY, _("City"), ETF_HAS_SIZE | ETF_HAS_APPLIED_PLAYER, _("Create city.")); @@ -753,13 +753,8 @@ void editor_apply_tool(const struct tile *ptile, case ETT_UNIT: if (erase) { - unit_list_iterate(ptile->units, punit) { -if (apno != player_number(punit->owner)) { - continue; -} -dsend_packet_edit_unit_remove(&client.conn, punit->id); -break; - } unit_list_iterate_end; + dsend_packet_edit_unit_remove(&client.conn, apno, +ptile->x, ptile->y, value, count); } else { dsend_packet_edit_unit_create(&client.conn, apno, ptile->x, ptile->y, value, count); diff --git a/common/packets.def b/common/packets.def index 84a8965..451ac90 100644 --- a/common/packets.def +++ b/common/packets.def @@ -1496,7 +1496,10 @@ PACKET_EDIT_UNIT_CREATE=162;cs,handle-per-conn,dsend end PACKET_EDIT_UNIT_REMOVE=163;cs,handle-per-conn,dsend - UNIT id; + PLAYER owner; + COORD x,y; + UNIT_TYPE type; + UINT8 count; end PACKET_EDIT_UNIT=164;cs,handle-per-conn,handle-via-packet diff --git a/server/edithand.c b/server/edithand.c index 6cae087..63824d9 100644 --- a/server/edithand.c +++ b/server/edithand.c @@ -388,7 +388,7 @@ void handle_edit_unit_create(struct connection *pc, int owner, ptile = map_pos_to_tile(x, y); if (!ptile) { notify_conn(pc->self, NULL, E_BAD_COMMAND, -_("Cannot edit the tile (%d, %d) because " +_("Cannot create units at tile (%d, %d) because " "it is not on the map!"), x, y); return; } @@ -445,11 +445,16 @@ void handle_edit_unit_create(struct connection *pc, int owner, } / - Remove a unit with the given id. + Remove 'count' units of type 'utid' owned by player number 'owner' at + tile (x, y). / -void handle_edit_unit_remove(struct connection *pc, int id) +void handle_edit_unit_remove(struct connection *pc, int owner, + int x, int y, Unit_type_id utid, int count) { - struct unit *punit; + struct tile *ptile; + struct unit_type *punittype; + struct player *pplayer; + int i; if (!can_conn_edit(pc)) { notify_conn(pc->self, NULL, E_BAD_COMMAND, @@ -457,14 +462,44 @@ void handle_edit_unit_remove(struct connection *pc, int id) return; } - punit = game_find_unit_by_number(id); - if (!punit) { + ptile = map_pos_to_tile(x, y); + if (!ptile) { notify_conn(pc->self, NULL, E_BAD_COMMAND, -_("Cannot remove unit with unknown id %d."), id); +_("Cannot remove units at tile (%d, %d) because " + "it is not on the map!"), x, y); +return; + } + + punittype = utype_by_number(utid); + if (!punittype) { +notify_conn(pc->self, ptile, E_BAD_COMMAND, +_("Cannot remove a unit at (%d, %d) because the " + "given unit type id %d is invalid."), x, y, utid); return; } - wipe_unit(punit); + pplayer = valid_player_by_number(owner); + if (!pplayer) { +notify_conn(pc->self, ptile, E_BAD_COMMAND, +_("Cannot remove a unit of type %s at (%d, %d) " + "because the given owner's player id %d is " + "invalid."), utype_name_translation(punittype), +x, y, owner); +return; + } + + i = 0; + unit_list_iterate_safe(ptile->units, punit) { +if (i >= count) { + break; +} +if (unit_type(punit) != punittype +|| unit_owner(punit) != pplayer) { + continue; +} +wipe_unit(punit); +i++; + } unit_list_iterate_safe_end; } ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40420) Editing mode allows adding units/cities to dead player
http://bugs.freeciv.org/Ticket/Display.html?id=40420 > > [book - Wed Aug 13 20:40:57 2008]: > > > [EMAIL PROTECTED] - Sat Aug 09 23:00:44 2008]: > > > > Or it could bring the dead player back to life...could be desirable > > for scenario editing but is a bit more work to code I'm sure. > > As far as I can see, all that is needed is to set > pplayer->is_alive to TRUE, and send the player info. > At least, I observed no immediate ill effects when > I added code to do this when units or cities are > created for already dead players (patch attached). Committed to S2_2 (r15144) and trunk (r15147). --- テーブルの下に鼠が三匹います。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40432) [Editor] Property editor as tab in bottom notebook
http://bugs.freeciv.org/Ticket/Display.html?id=40432 > Committed to S2_2 (r15145) and trunk (r15148). -- 足の先をなめている猫は椅子の上にいます。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40437) [Editor] Some more read-only tile properties
http://bugs.freeciv.org/Ticket/Display.html?id=40437 > > [book - Wed Aug 13 21:18:53 2008]: > > Patch adds 5 read-only tile properties: x, y, nat_x, nat_y, > and continent. Illustrates the best case of code duplication > elimination using the property editor framework. :) Committed to S2_2 (r15146) and trunk (r15149). -- 笑っている猿が木の上で跳ね回っています。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev