[Freeciv-commits] r31583 - in /branches/S2_6/client: tilespec.c tilespec.h
Author: cazfi Date: Mon Jan 25 12:24:17 2016 New Revision: 31583 URL: http://svn.gna.org/viewcvs/freeciv?rev=31583&view=rev Log: tileset_load_toplevel() can be limited to accept only specific topology tileset. See patch #6844 Modified: branches/S2_6/client/tilespec.c branches/S2_6/client/tilespec.h Modified: branches/S2_6/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=31583&r1=31582&r2=31583&view=diff == --- branches/S2_6/client/tilespec.c (original) +++ branches/S2_6/client/tilespec.c Mon Jan 25 12:24:17 2016 @@ -983,7 +983,7 @@ tilesets = strvec_new(); strvec_iterate(list, file) { - struct tileset *t = tileset_read_toplevel(file, FALSE); + struct tileset *t = tileset_read_toplevel(file, FALSE, -1); if (t) { strvec_append(tilesets, file); @@ -1159,11 +1159,11 @@ ***/ void tilespec_try_read(const char *tileset_name, bool verbose) { - if (!(tileset = tileset_read_toplevel(tileset_name, verbose))) { + if (!(tileset = tileset_read_toplevel(tileset_name, verbose, -1))) { struct strvec *list = fileinfolist(get_data_dirs(), TILESPEC_SUFFIX); strvec_iterate(list, file) { - struct tileset *t = tileset_read_toplevel(file, FALSE); + struct tileset *t = tileset_read_toplevel(file, FALSE, -1); if (t) { if (!tileset) { @@ -1233,8 +1233,8 @@ * * We read in the new tileset. This should be pretty straightforward. */ - if (!(tileset = tileset_read_toplevel(tileset_name, FALSE))) { -if (!(tileset = tileset_read_toplevel(old_name, FALSE))) { + if (!(tileset = tileset_read_toplevel(tileset_name, FALSE, -1))) { +if (!(tileset = tileset_read_toplevel(old_name, FALSE, -1))) { /* Always fails. */ fc_assert_exit_msg(NULL != tileset, "Failed to re-read the currently loaded tileset."); @@ -1613,8 +1613,10 @@ Finds and reads the toplevel tilespec file based on given name. Sets global variables, including tile sizes and full names for intro files. + topology_id of -1 means any topology is acceptable. ***/ -struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose) +struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose, + int topology_id) { struct section_file *file; char *fname; @@ -1630,6 +1632,7 @@ struct tileset *t = NULL; const char *extraname; const char *tstr; + int topo; fname = tilespec_fullname(tileset_name); if (!fname) { @@ -1721,6 +1724,12 @@ goto ON_ERROR; } + if (t->type == TS_ISOMETRIC) { +topo = TF_ISO; + } else { +topo = 0; + } + /* Read hex-tileset information. */ t->hex_width = t->hex_height = 0; if (is_hex) { @@ -1736,10 +1745,18 @@ } else { t->hex_height = hex_side; } + +topo |= TF_HEX; + /* Hex tilesets are drawn the same as isometric. */ /* FIXME: There will be other legal values to be used with hex * tileset in the future, and this would just overwrite it. */ t->type = TS_ISOMETRIC; + } + + if (topology_id >= 0 && topo != (topology_id & (TF_ISO | TF_HEX))) { +/* Not of requested topology */ +goto ON_ERROR; } if (!is_view_supported(t->type)) { Modified: branches/S2_6/client/tilespec.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.h?rev=31583&r1=31582&r2=31583&view=diff == --- branches/S2_6/client/tilespec.h (original) +++ branches/S2_6/client/tilespec.h Mon Jan 25 12:24:17 2016 @@ -174,7 +174,8 @@ void tileset_error(enum log_level level, const char *format, ...); -struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose); +struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose, + int topology_id); void tileset_init(struct tileset *t); void tileset_free(struct tileset *tileset); void tileset_load_tiles(struct tileset *t); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31582 - in /trunk/client: tilespec.c tilespec.h
Author: cazfi Date: Mon Jan 25 12:24:11 2016 New Revision: 31582 URL: http://svn.gna.org/viewcvs/freeciv?rev=31582&view=rev Log: tileset_load_toplevel() can be limited to accept only specific topology tileset. See patch #6844 Modified: trunk/client/tilespec.c trunk/client/tilespec.h Modified: trunk/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=31582&r1=31581&r2=31582&view=diff == --- trunk/client/tilespec.c (original) +++ trunk/client/tilespec.c Mon Jan 25 12:24:11 2016 @@ -973,7 +973,7 @@ tilesets = strvec_new(); strvec_iterate(list, file) { - struct tileset *t = tileset_read_toplevel(file, FALSE); + struct tileset *t = tileset_read_toplevel(file, FALSE, -1); if (t) { strvec_append(tilesets, file); @@ -1145,11 +1145,11 @@ ***/ void tilespec_try_read(const char *tileset_name, bool verbose) { - if (!(tileset = tileset_read_toplevel(tileset_name, verbose))) { + if (!(tileset = tileset_read_toplevel(tileset_name, verbose, -1))) { struct strvec *list = fileinfolist(get_data_dirs(), TILESPEC_SUFFIX); strvec_iterate(list, file) { - struct tileset *t = tileset_read_toplevel(file, FALSE); + struct tileset *t = tileset_read_toplevel(file, FALSE, -1); if (t) { if (!tileset) { @@ -1219,8 +1219,8 @@ * * We read in the new tileset. This should be pretty straightforward. */ - if (!(tileset = tileset_read_toplevel(tileset_name, FALSE))) { -if (!(tileset = tileset_read_toplevel(old_name, FALSE))) { + if (!(tileset = tileset_read_toplevel(tileset_name, FALSE, -1))) { +if (!(tileset = tileset_read_toplevel(old_name, FALSE, -1))) { /* Always fails. */ fc_assert_exit_msg(NULL != tileset, "Failed to re-read the currently loaded tileset."); @@ -1596,8 +1596,10 @@ Finds and reads the toplevel tilespec file based on given name. Sets global variables, including tile sizes and full names for intro files. + topology_id of -1 means any topology is acceptable. ***/ -struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose) +struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose, + int topology_id) { struct section_file *file; char *fname; @@ -1613,6 +1615,7 @@ struct tileset *t = NULL; const char *extraname; const char *tstr; + int topo; fname = tilespec_fullname(tileset_name); if (!fname) { @@ -1704,6 +1707,12 @@ goto ON_ERROR; } + if (t->type == TS_ISOMETRIC) { +topo = TF_ISO; + } else { +topo = 0; + } + /* Read hex-tileset information. */ t->hex_width = t->hex_height = 0; if (is_hex) { @@ -1719,10 +1728,18 @@ } else { t->hex_height = hex_side; } + +topo |= TF_HEX; + /* Hex tilesets are drawn the same as isometric. */ /* FIXME: There will be other legal values to be used with hex * tileset in the future, and this would just overwrite it. */ t->type = TS_ISOMETRIC; + } + + if (topology_id >= 0 && topo != (topology_id & (TF_ISO | TF_HEX))) { +/* Not of requested topology */ +goto ON_ERROR; } if (!is_view_supported(t->type)) { Modified: trunk/client/tilespec.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.h?rev=31582&r1=31581&r2=31582&view=diff == --- trunk/client/tilespec.h (original) +++ trunk/client/tilespec.h Mon Jan 25 12:24:11 2016 @@ -174,7 +174,8 @@ void tileset_error(enum log_level level, const char *format, ...); -struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose); +struct tileset *tileset_read_toplevel(const char *tileset_name, bool verbose, + int topology_id); void tileset_init(struct tileset *t); void tileset_free(struct tileset *tileset); void tileset_load_tiles(struct tileset *t); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31585 - /branches/S2_6/data/scenarios/tileset-demo.sav
Author: cazfi Date: Mon Jan 25 13:35:24 2016 New Revision: 31585 URL: http://svn.gna.org/viewcvs/freeciv?rev=31585&view=rev Log: Added name property for tileset-demo scenario. See patch #6840 Modified: branches/S2_6/data/scenarios/tileset-demo.sav Modified: branches/S2_6/data/scenarios/tileset-demo.sav URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/scenarios/tileset-demo.sav?rev=31585&r1=31584&r2=31585&view=diff == --- branches/S2_6/data/scenarios/tileset-demo.sav (original) +++ branches/S2_6/data/scenarios/tileset-demo.sav Mon Jan 25 13:35:24 2016 @@ -2,6 +2,7 @@ [scenario] is_scenario=TRUE game_version=20599 +name=_("Tileset Demo") save_random=TRUE players=TRUE startpos_nations=FALSE ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31584 - /trunk/data/scenarios/tileset-demo.sav
Author: cazfi Date: Mon Jan 25 13:35:18 2016 New Revision: 31584 URL: http://svn.gna.org/viewcvs/freeciv?rev=31584&view=rev Log: Added name property for tileset-demo scenario. See patch #6840 Modified: trunk/data/scenarios/tileset-demo.sav Modified: trunk/data/scenarios/tileset-demo.sav URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/scenarios/tileset-demo.sav?rev=31584&r1=31583&r2=31584&view=diff == --- trunk/data/scenarios/tileset-demo.sav (original) +++ trunk/data/scenarios/tileset-demo.sav Mon Jan 25 13:35:18 2016 @@ -2,6 +2,7 @@ [scenario] is_scenario=TRUE game_version=20599 +name=_("Tileset Demo") save_random=TRUE players=TRUE startpos_nations=FALSE ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31586 - in /branches/S2_5: ./ client/ client/gui-sdl/ common/ server/ utility/
Author: cazfi Date: Mon Jan 25 13:46:45 2016 New Revision: 31586 URL: http://svn.gna.org/viewcvs/freeciv?rev=31586&view=rev Log: Use winsock2 on Windows builds. See patch #6533 Modified: branches/S2_5/client/client_main.c branches/S2_5/client/clinet.c branches/S2_5/client/connectdlg_common.c branches/S2_5/client/gui-sdl/gui_main.c branches/S2_5/client/servers.c branches/S2_5/common/connection.c branches/S2_5/common/dataio.c branches/S2_5/common/packets.c branches/S2_5/configure.ac branches/S2_5/server/meta.c branches/S2_5/server/sernet.c branches/S2_5/server/srv_main.c branches/S2_5/utility/fcthread.h branches/S2_5/utility/ioz.c branches/S2_5/utility/netintf.c branches/S2_5/utility/netintf.h branches/S2_5/utility/shared.c branches/S2_5/utility/support.c Modified: branches/S2_5/client/client_main.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/client_main.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/client/client_main.c (original) +++ branches/S2_5/client/client_main.c Mon Jan 25 13:46:45 2016 @@ -14,6 +14,15 @@ #ifdef HAVE_CONFIG_H #include #endif + +/* Must be before */ +#ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ +#include +#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK */ #ifdef WIN32_NATIVE #include/* LoadLibrary() */ Modified: branches/S2_5/client/clinet.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/clinet.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/client/clinet.c (original) +++ branches/S2_5/client/clinet.c Mon Jan 25 13:46:45 2016 @@ -54,8 +54,12 @@ #include #endif #ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ #include -#endif +#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK */ /* utility */ #include "capstr.h" Modified: branches/S2_5/client/connectdlg_common.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/connectdlg_common.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/client/connectdlg_common.c(original) +++ branches/S2_5/client/connectdlg_common.cMon Jan 25 13:46:45 2016 @@ -19,6 +19,15 @@ #include /* SIGTERM and kill */ #include #include + +/* Must be before */ +#ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ +#include +#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK */ #ifdef WIN32_NATIVE #include Modified: branches/S2_5/client/gui-sdl/gui_main.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/gui_main.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/client/gui-sdl/gui_main.c (original) +++ branches/S2_5/client/gui-sdl/gui_main.c Mon Jan 25 13:46:45 2016 @@ -34,8 +34,12 @@ #endif #ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ #include -#endif +#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK */ #include "SDL/SDL.h" Modified: branches/S2_5/client/servers.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/servers.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/client/servers.c (original) +++ branches/S2_5/client/servers.c Mon Jan 25 13:46:45 2016 @@ -49,7 +49,14 @@ #include #endif #ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ #include +#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK */ +#ifdef HAVE_WS2TCPIP_H +#include #endif /* dependencies */ Modified: branches/S2_5/common/connection.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/connection.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/common/connection.c (original) +++ branches/S2_5/common/connection.c Mon Jan 25 13:46:45 2016 @@ -30,8 +30,12 @@ #include #endif #ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ #include -#endif +#endif /* HAVE_WINSOCK2 */ +#endif /* HAVE_WINSOCK */ /* utility */ #include "fcintl.h" Modified: branches/S2_5/common/dataio.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/dataio.c?rev=31586&r1=31585&r2=31586&view=diff == --- branches/S2_5/common/dataio.c (original) +++ branches/S2_5/common/dataio.c Mon Jan 25 13:46:45 2016 @@ -43,8 +43,12 @@ #include #endif #ifdef HAVE_WINSOCK +#ifdef HAVE_WINSOCK2 +#include +#else /* HAVE_WINSOCK2 */ #include -#endif +#e
[Freeciv-commits] r31587 - in /trunk/server: savegame2.c savegame3.c
Author: cazfi Date: Mon Jan 25 15:14:38 2016 New Revision: 31587 URL: http://svn.gna.org/viewcvs/freeciv?rev=31587&view=rev Log: De not fill terrident mappings from the current version of the ruleset. See bug #24325 Modified: trunk/server/savegame2.c trunk/server/savegame3.c Modified: trunk/server/savegame2.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame2.c?rev=31587&r1=31586&r2=31587&view=diff == --- trunk/server/savegame2.c(original) +++ trunk/server/savegame2.cMon Jan 25 15:14:38 2016 @@ -1396,15 +1396,8 @@ } terrain_type_iterate(pterr) { -if (pterr->identifier_load == '\0') { - /* Use the current identifier for unknown ones. */ - pterr->identifier_load = pterr->identifier; -} - } terrain_type_iterate_end; - - terrain_type_iterate(pterr) { terrain_type_iterate(pterr2) { - if (pterr != pterr2) { + if (pterr != pterr2 && pterr->identifier_load != '\0') { sg_failure_ret((pterr->identifier_load != pterr2->identifier_load), "%s and %s share a saved identifier", terrain_rule_name(pterr), terrain_rule_name(pterr2)); Modified: trunk/server/savegame3.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=31587&r1=31586&r2=31587&view=diff == --- trunk/server/savegame3.c(original) +++ trunk/server/savegame3.cMon Jan 25 15:14:38 2016 @@ -1469,15 +1469,8 @@ } terrain_type_iterate(pterr) { -if (pterr->identifier_load == '\0') { - /* Use the current identifier for unknown ones. */ - pterr->identifier_load = pterr->identifier; -} - } terrain_type_iterate_end; - - terrain_type_iterate(pterr) { terrain_type_iterate(pterr2) { - if (pterr != pterr2) { + if (pterr != pterr2 && pterr->identifier_load != '\0') { sg_failure_ret((pterr->identifier_load != pterr2->identifier_load), "%s and %s share a saved identifier", terrain_rule_name(pterr), terrain_rule_name(pterr2)); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31588 - /branches/S2_6/server/savegame2.c
Author: cazfi Date: Mon Jan 25 15:14:50 2016 New Revision: 31588 URL: http://svn.gna.org/viewcvs/freeciv?rev=31588&view=rev Log: De not fill terrident mappings from the current version of the ruleset. See bug #24325 Modified: branches/S2_6/server/savegame2.c Modified: branches/S2_6/server/savegame2.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savegame2.c?rev=31588&r1=31587&r2=31588&view=diff == --- branches/S2_6/server/savegame2.c(original) +++ branches/S2_6/server/savegame2.cMon Jan 25 15:14:50 2016 @@ -1869,15 +1869,8 @@ } terrain_type_iterate(pterr) { -if (pterr->identifier_load == '\0') { - /* Use the current identifier for unknown ones. */ - pterr->identifier_load = pterr->identifier; -} - } terrain_type_iterate_end; - - terrain_type_iterate(pterr) { terrain_type_iterate(pterr2) { - if (pterr != pterr2) { + if (pterr != pterr2 && pterr->identifier_load != '\0') { sg_failure_ret((pterr->identifier_load != pterr2->identifier_load), "%s and %s share a saved identifier", terrain_rule_name(pterr), terrain_rule_name(pterr2)); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31590 - in /branches/S2_6/data/civ2civ3: README.civ2civ3 effects.ruleset techs.ruleset terrain.ruleset
Author: cazfi Date: Mon Jan 25 15:24:02 2016 New Revision: 31590 URL: http://svn.gna.org/viewcvs/freeciv?rev=31590&view=rev Log: Added Oil Platform extra to civ2civ3 ruleset. Mines are available on all land tiles, and Oil Wells now act as an upgrade to them on certain terrains. Patch by David Fernandez See patch #5915 Modified: branches/S2_6/data/civ2civ3/README.civ2civ3 branches/S2_6/data/civ2civ3/effects.ruleset branches/S2_6/data/civ2civ3/techs.ruleset branches/S2_6/data/civ2civ3/terrain.ruleset Modified: branches/S2_6/data/civ2civ3/README.civ2civ3 URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/civ2civ3/README.civ2civ3?rev=31590&r1=31589&r2=31590&view=diff == --- branches/S2_6/data/civ2civ3/README.civ2civ3 (original) +++ branches/S2_6/data/civ2civ3/README.civ2civ3 Mon Jan 25 15:24:02 2016 @@ -200,12 +200,15 @@ obtained by irrigating the Swamp. - Hills receive 1 Shield for free, and +2 from mines, same as civ3, - (was 0 and +3). + (was 0 and +3). Mountains receive +2 Shields from mines too (was +1). - Mountains give extra vision range. Cities can not be placed over Mountains. Land units starting the turn on unroaded Mountains receive a -1 penalty to movement (this way it is not so good for cavalry to end the turn on Mountains). + +- The discovery of Refining allows to upgrade the mines placed on + Deserts and Glaciers to Oil Wells (+2 Shields). - Lake tiles receive for free +1 Food (2/0/2), while Harbours and Offshore Platforms do not affect them. Lakes do not enable wonders @@ -227,20 +230,20 @@ TILE F/P/T IRRIG(t) MINE(t)ROAD MAX1 MAX2 TRANSFORM Deep 1/0/2 NO NO NO 2/0/2 2/1/2 No Ocean 1/0/2 NO NO NO 2/0/2 2/1/2 Grass(36) -Lake *2/0/2 NO NO NO 2/0/2 2/0/2 Grass(36) +Lake *2/0/2 NO NO NO 2/0/2 2/1/2 *Grass(36) Swamp 1/0/0 *+1(5) *NO +0(4) 2/0/0 3/0/0 *Grass(24) -Glacier 0/0/0 NO +1(10) +0(4) 0/1/0 0/1/0 *Lake(24) +Glacier 0/0/0 NO +1(10) +0(4) 0/1/0 0/3/0 *Lake(24) Tundra1/0/0 *NO*+1(5) *+1(2) 1/1/1 1/1/1 *Plains(24) -Desert0/1/0 +1(5) +1(5) +1(2) 0/2/1 0/3/1 Plains(24) +Desert0/1/0 +1(5) +1(5) +1(2) 0/2/1 0/4/1 Plains(24) Plains1/1/0 +1(5) Forest(10) +1(2) 2/1/1 3/1/1 *Lake(36) Grassland 2/0/0 +1(5) Forest(15) +1(2) 3/0/1 4/0/1 *Lake(36) Jungle *1/1/0 *Swamp(10) *NO +0(4) 1/1/0 1/1/0 *Forest(24) Forest1/2/0 Plain(10) *Grass(15) +0(4) 1/2/0 1/3/0 *Hills(24) Hills*1/1/0 +1(10)*+2(10) +0(4) 1/3/0 1/4/0 Plains(24) -Mountains 0/1/0 NO +1(10) +0(6) 0/2/0 0/3/0 Hills(36) +Mountains 0/1/0 NO*+2(10) +0(6) 0/3/0 0/4/0 Hills(36) F/P/T = Food/Production/Trade; (t) = turns -MAX1 = irrigated/mined/roaded/harbour; MAX2 = farmland/railroad/offshore. +MAX1 = irrigated/mined/roaded/harbour; MAX2 = farmland/railroad/oil well. * = Changes compared to classic ruleset. Most affected are Jungles, Swamps and Tundras. @@ -920,6 +923,9 @@ Lake. It is still possible to transform any terrain to Hills by changing them to Forest first. +- Mountains receive +2 Shields from mines, same than Hills. The tech + Refining allows to upgrade the mines placed on Deserts and Glaciers + to Oil Wells (+2 Shields). - Deep ocean tiles must be mined in order to take advantage of the shield bonus from Offshore Platforms (buoys are no longer needed). - Readjusted transformations caused by global warming and nuclear Modified: branches/S2_6/data/civ2civ3/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/civ2civ3/effects.ruleset?rev=31590&r1=31589&r2=31590&view=diff == --- branches/S2_6/data/civ2civ3/effects.ruleset (original) +++ branches/S2_6/data/civ2civ3/effects.ruleset Mon Jan 25 15:24:02 2016 @@ -2362,20 +2362,20 @@ value = 1 reqs= { "type", "name", "range" - "Terrain", "Ocean", "Local" + "TerrainClass", "Oceanic", "Local" "Building", "Offshore Platform", "City" "OutputType", "Shield", "Local" } [effect_offshore_platform_1] type= "Output_Add_Tile" -value = 1 -reqs= -{ "type", "name", "range" - "Terrain", "Deep Ocean", "Local" - "Building", "Offshore Platform", "City" - "Extra", "Oil Well", "Local" - "OutputType", "Shield", "Local" +value = -1 +reqs= +{ "type", "name", "range", "present" + "Terrain", "Deep Ocean", "Local", TRUE + "Building", "Offshore Platform", "City", TRUE + "Extra", "Oil Platform", "Local", FALSE + "OutputType", "Shield", "Local", TRUE } [effect_offshore_platform_2] @@ -2874,42 +2874,6 @@ "Building", "Super Highways",
[Freeciv-commits] r31589 - in /trunk/data/civ2civ3: README.civ2civ3 effects.ruleset techs.ruleset terrain.ruleset
Author: cazfi Date: Mon Jan 25 15:23:56 2016 New Revision: 31589 URL: http://svn.gna.org/viewcvs/freeciv?rev=31589&view=rev Log: Added Oil Platform extra to civ2civ3 ruleset. Mines are available on all land tiles, and Oil Wells now act as an upgrade to them on certain terrains. Patch by David Fernandez See patch #5915 Modified: trunk/data/civ2civ3/README.civ2civ3 trunk/data/civ2civ3/effects.ruleset trunk/data/civ2civ3/techs.ruleset trunk/data/civ2civ3/terrain.ruleset Modified: trunk/data/civ2civ3/README.civ2civ3 URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/README.civ2civ3?rev=31589&r1=31588&r2=31589&view=diff == --- trunk/data/civ2civ3/README.civ2civ3 (original) +++ trunk/data/civ2civ3/README.civ2civ3 Mon Jan 25 15:23:56 2016 @@ -200,12 +200,15 @@ obtained by irrigating the Swamp. - Hills receive 1 Shield for free, and +2 from mines, same as civ3, - (was 0 and +3). + (was 0 and +3). Mountains receive +2 Shields from mines too (was +1). - Mountains give extra vision range. Cities can not be placed over Mountains. Land units starting the turn on unroaded Mountains receive a -1 penalty to movement (this way it is not so good for cavalry to end the turn on Mountains). + +- The discovery of Refining allows to upgrade the mines placed on + Deserts and Glaciers to Oil Wells (+2 Shields). - Lake tiles receive for free +1 Food (2/0/2), while Harbours and Offshore Platforms do not affect them. Lakes do not enable wonders @@ -227,20 +230,20 @@ TILE F/P/T IRRIG(t) MINE(t)ROAD MAX1 MAX2 TRANSFORM Deep 1/0/2 NO NO NO 2/0/2 2/1/2 No Ocean 1/0/2 NO NO NO 2/0/2 2/1/2 Grass(36) -Lake *2/0/2 NO NO NO 2/0/2 2/0/2 Grass(36) +Lake *2/0/2 NO NO NO 2/0/2 2/1/2 *Grass(36) Swamp 1/0/0 *+1(5) *NO +0(4) 2/0/0 3/0/0 *Grass(24) -Glacier 0/0/0 NO +1(10) +0(4) 0/1/0 0/1/0 *Lake(24) +Glacier 0/0/0 NO +1(10) +0(4) 0/1/0 0/3/0 *Lake(24) Tundra1/0/0 *NO*+1(5) *+1(2) 1/1/1 1/1/1 *Plains(24) -Desert0/1/0 +1(5) +1(5) +1(2) 0/2/1 0/3/1 Plains(24) +Desert0/1/0 +1(5) +1(5) +1(2) 0/2/1 0/4/1 Plains(24) Plains1/1/0 +1(5) Forest(10) +1(2) 2/1/1 3/1/1 *Lake(36) Grassland 2/0/0 +1(5) Forest(15) +1(2) 3/0/1 4/0/1 *Lake(36) Jungle *1/1/0 *Swamp(10) *NO +0(4) 1/1/0 1/1/0 *Forest(24) Forest1/2/0 Plain(10) *Grass(15) +0(4) 1/2/0 1/3/0 *Hills(24) Hills*1/1/0 +1(10)*+2(10) +0(4) 1/3/0 1/4/0 Plains(24) -Mountains 0/1/0 NO +1(10) +0(6) 0/2/0 0/3/0 Hills(36) +Mountains 0/1/0 NO*+2(10) +0(6) 0/3/0 0/4/0 Hills(36) F/P/T = Food/Production/Trade; (t) = turns -MAX1 = irrigated/mined/roaded/harbour; MAX2 = farmland/railroad/offshore. +MAX1 = irrigated/mined/roaded/harbour; MAX2 = farmland/railroad/oil well. * = Changes compared to classic ruleset. Most affected are Jungles, Swamps and Tundras. @@ -920,6 +923,9 @@ Lake. It is still possible to transform any terrain to Hills by changing them to Forest first. +- Mountains receive +2 Shields from mines, same than Hills. The tech + Refining allows to upgrade the mines placed on Deserts and Glaciers + to Oil Wells (+2 Shields). - Deep ocean tiles must be mined in order to take advantage of the shield bonus from Offshore Platforms (buoys are no longer needed). - Readjusted transformations caused by global warming and nuclear Modified: trunk/data/civ2civ3/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/effects.ruleset?rev=31589&r1=31588&r2=31589&view=diff == --- trunk/data/civ2civ3/effects.ruleset (original) +++ trunk/data/civ2civ3/effects.ruleset Mon Jan 25 15:23:56 2016 @@ -2363,20 +2363,20 @@ value = 1 reqs= { "type", "name", "range" - "Terrain", "Ocean", "Local" + "TerrainClass", "Oceanic", "Local" "Building", "Offshore Platform", "City" "OutputType", "Shield", "Local" } [effect_offshore_platform_1] type= "Output_Add_Tile" -value = 1 -reqs= -{ "type", "name", "range" - "Terrain", "Deep Ocean", "Local" - "Building", "Offshore Platform", "City" - "Extra", "Oil Well", "Local" - "OutputType", "Shield", "Local" +value = -1 +reqs= +{ "type", "name", "range", "present" + "Terrain", "Deep Ocean", "Local", TRUE + "Building", "Offshore Platform", "City", TRUE + "Extra", "Oil Platform", "Local", FALSE + "OutputType", "Shield", "Local", TRUE } [effect_offshore_platform_2] @@ -2875,42 +2875,6 @@ "Building", "Super Highways", "City" } -[effect_mine] -type= "Mining_Pct" -value = 100 -reqs= -{ "type",
[Freeciv-commits] r31591 - in /trunk: common/ data/alien/ data/civ2civ3/ data/classic/ data/experimental/ data/multiplayer/ data/sandbox/ data...
Author: sveinung Date: Mon Jan 25 16:43:39 2016 New Revision: 31591 URL: http://svn.gna.org/viewcvs/freeciv?rev=31591&view=rev Log: Document that unupgradeable units don't upgrade. A unit type without a unit type to upgrade to can never do "Upgrade Unit". The unit type a unit type upgrades to is currently specified in the obsolete_by unit type field. Document that the "Upgrade Unit" action requires the obsolete_by field in the ruleset comments. This informs the ruleset authors. Make "Upgrade Unit"'s hard actor unit type requirements aware that an upgrade target unit type is needed. This informs the auto generated help and other areas of Freeciv that reason about actions. See patch #6847 Modified: trunk/common/actions.c trunk/data/alien/units.ruleset trunk/data/civ2civ3/units.ruleset trunk/data/classic/units.ruleset trunk/data/experimental/units.ruleset trunk/data/multiplayer/units.ruleset trunk/data/sandbox/units.ruleset trunk/data/stub/units.ruleset Modified: trunk/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/common/actions.c (original) +++ trunk/common/actions.c Mon Jan 25 16:43:39 2016 @@ -978,6 +978,13 @@ } } + if (wanted_action == ACTION_UPGRADE_UNIT) { +if (actor_unittype->obsoleted_by == U_NOT_OBSOLETED) { + /* Reason: Nothing to upgrade to. */ + return FALSE; +} + } + return TRUE; } Modified: trunk/data/alien/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/units.ruleset?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/data/alien/units.ruleset (original) +++ trunk/data/alien/units.ruleset Mon Jan 25 16:43:39 2016 @@ -344,6 +344,8 @@ ; bombard_rate = the number of shots fired at enemy units when attacking ; "Join City" ; pop_cost = the number of population added to the target city +; "Upgrade Unit" +; obsolete_by = the unit type upgraded to. ; ; ** Roles ** ; Modified: trunk/data/civ2civ3/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/units.ruleset?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/data/civ2civ3/units.ruleset (original) +++ trunk/data/civ2civ3/units.ruleset Mon Jan 25 16:43:39 2016 @@ -384,6 +384,8 @@ ; bombard_rate = the number of shots fired at enemy units when attacking ; "Join City" ; pop_cost = the number of population added to the target city +; "Upgrade Unit" +; obsolete_by = the unit type upgraded to. ; ; ** Roles ** ; Modified: trunk/data/classic/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/units.ruleset?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/data/classic/units.ruleset(original) +++ trunk/data/classic/units.rulesetMon Jan 25 16:43:39 2016 @@ -358,6 +358,8 @@ ; bombard_rate = the number of shots fired at enemy units when attacking ; "Join City" ; pop_cost = the number of population added to the target city +; "Upgrade Unit" +; obsolete_by = the unit type upgraded to. ; ; ** Roles ** ; Modified: trunk/data/experimental/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/units.ruleset?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/data/experimental/units.ruleset (original) +++ trunk/data/experimental/units.ruleset Mon Jan 25 16:43:39 2016 @@ -372,6 +372,8 @@ ; bombard_rate = the number of shots fired at enemy units when attacking ; "Join City" ; pop_cost = the number of population added to the target city +; "Upgrade Unit" +; obsolete_by = the unit type upgraded to. ; ; ** Roles ** ; Modified: trunk/data/multiplayer/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/units.ruleset?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/data/multiplayer/units.ruleset(original) +++ trunk/data/multiplayer/units.rulesetMon Jan 25 16:43:39 2016 @@ -357,6 +357,8 @@ ; bombard_rate = the number of shots fired at enemy units when attacking ; "Join City" ; pop_cost = the number of population added to the target city +; "Upgrade Unit" +; obsolete_by = the unit type upgraded to. ; ; ** Roles ** ; Modified: trunk/data/sandbox/units.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/sandbox/units.ruleset?rev=31591&r1=31590&r2=31591&view=diff == --- trunk/data/sandbox/units.ruleset(original) +++ trunk/data/sandbox/units.r
[Freeciv-commits] r31593 - /trunk/server/srv_main.c
Author: jtn Date: Mon Jan 25 19:33:22 2016 New Revision: 31593 URL: http://svn.gna.org/viewcvs/freeciv?rev=31593&view=rev Log: Update map retry after bug #24319 introduced seed_setting. A failing player-specified mapseed is no longer pointlessly retried. See gna bug #24341. Modified: trunk/server/srv_main.c Modified: trunk/server/srv_main.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/srv_main.c?rev=31593&r1=31592&r2=31593&view=diff == --- trunk/server/srv_main.c (original) +++ trunk/server/srv_main.c Mon Jan 25 19:33:22 2016 @@ -2830,7 +2830,9 @@ { "teamplacement", } }; int i; -bool retry_ok = (game.map.server.seed == 0 +/* If a specific seed has been requested, there's no point retrying, + * as the map will be the same every time. */ +bool retry_ok = (game.map.server.seed_setting == 0 && game.map.server.generator != MAPGEN_SCENARIO); int max = retry_ok ? 3 : 1; bool created = FALSE; @@ -2865,6 +2867,9 @@ if (!created && max > 1) { int set; +/* If we're retrying, seed_setting==0, which will yield a new map + * next time */ +fc_assert(game.map.server.seed_setting == 0); if (i == 0) { /* We will retry only if max attempts allow it */ log_normal(_("Failed to create suitable map, retrying with another mapseed.")); @@ -2875,8 +2880,6 @@ * +2 */ log_normal(_("Attempt %d/%d"), i + 2, max); } -/* Reset mapseed so generator knows to use new one */ -game.map.server.seed = 0; /* One should never set this to false in scenario map that had resources * placed. We are safe side here as map generation is retried only if this is * not scenario map at all. */ ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31596 - /trunk/client/tilespec.c
Author: jtn Date: Mon Jan 25 19:33:32 2016 New Revision: 31596 URL: http://svn.gna.org/viewcvs/freeciv?rev=31596&view=rev Log: Don't draw goto state sprites with fog. See gna bug #24342. Modified: trunk/client/tilespec.c Modified: trunk/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=31596&r1=31595&r2=31596&view=diff == --- trunk/client/tilespec.c (original) +++ trunk/client/tilespec.c Mon Jan 25 19:33:32 2016 @@ -4969,7 +4969,7 @@ sprite = t->sprites.path.s[state].specific; if (sprite != NULL) { -ADD_SPRITE_SIMPLE(sprite); +ADD_SPRITE(sprite, FALSE, 0, 0); } sprite = t->sprites.path.s[state].turns[length % 10]; @@ -4994,7 +4994,7 @@ } if (waypoint) { - ADD_SPRITE_SIMPLE(t->sprites.path.waypoint); + ADD_SPRITE(t->sprites.path.waypoint, FALSE, 0, 0); } if (warn) { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31594 - in /trunk/common/scriptcore: api_game_methods.c api_game_methods.h tolua_game.pkg
Author: jtn Date: Mon Jan 25 19:33:25 2016 New Revision: 31594 URL: http://svn.gna.org/viewcvs/freeciv?rev=31594&view=rev Log: Lua: add Unit:transporter(), Unit:cargo_iterate(). See gna patch #6845. Modified: trunk/common/scriptcore/api_game_methods.c trunk/common/scriptcore/api_game_methods.h trunk/common/scriptcore/tolua_game.pkg Modified: trunk/common/scriptcore/api_game_methods.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/api_game_methods.c?rev=31594&r1=31593&r2=31594&view=diff == --- trunk/common/scriptcore/api_game_methods.c (original) +++ trunk/common/scriptcore/api_game_methods.c Mon Jan 25 19:33:25 2016 @@ -899,6 +899,28 @@ } /* + Return Unit that transports punit, if any. +*/ +Unit *api_methods_unit_transporter(lua_State *L, Unit *punit) +{ + LUASCRIPT_CHECK_STATE(L, NULL); + LUASCRIPT_CHECK_SELF(L, punit, NULL); + + return punit->transporter; +} + +/* + Return list head for cargo list for Unit +*/ +Unit_List_Link *api_methods_private_unit_cargo_list_head(lua_State *L, + Unit *punit) +{ + LUASCRIPT_CHECK_STATE(L, NULL); + LUASCRIPT_CHECK_SELF(L, punit, NULL); + return unit_list_head(punit->transporting); +} + +/* Return TRUE if punit_type has flag. */ bool api_methods_unit_type_has_flag(lua_State *L, Unit_Type *punit_type, Modified: trunk/common/scriptcore/api_game_methods.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/api_game_methods.h?rev=31594&r1=31593&r2=31594&view=diff == --- trunk/common/scriptcore/api_game_methods.h (original) +++ trunk/common/scriptcore/api_game_methods.h Mon Jan 25 19:33:25 2016 @@ -140,6 +140,9 @@ bool api_methods_unit_city_can_be_built_here(lua_State *L, Unit *punit); Tile *api_methods_unit_tile_get(lua_State *L, Unit * punit); Direction api_methods_unit_orientation_get(lua_State *L, Unit *punit); +Unit *api_methods_unit_transporter(lua_State *L, Unit *punit); +Unit_List_Link *api_methods_private_unit_cargo_list_head(lua_State *L, + Unit *punit); /* Unit Type */ bool api_methods_unit_type_has_flag(lua_State *L, Unit_Type *punit_type, Modified: trunk/common/scriptcore/tolua_game.pkg URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/tolua_game.pkg?rev=31594&r1=31593&r2=31594&view=diff == --- trunk/common/scriptcore/tolua_game.pkg (original) +++ trunk/common/scriptcore/tolua_game.pkg Mon Jan 25 19:33:25 2016 @@ -215,10 +215,19 @@ @ tile(lua_State *L, Unit *self); } + Unit *api_methods_unit_transporter +@ transporter (lua_State *L, Unit *self); bool api_methods_unit_city_can_be_built_here @ is_on_possible_city_tile (lua_State *L, Unit *self); Direction api_methods_unit_orientation_get @ facing(lua_State *L, Unit *self); +} + +module methods_private { + module Unit { +Unit_List_Link *api_methods_private_unit_cargo_list_head + @ cargo_list_head (lua_State *L, Unit *self); + } } $[ @@ -535,6 +544,11 @@ function Tile:units_iterate() return safe_iterate_list(private.Tile.unit_list_head(self)) end + + -- Safe iteration over the units transported by Unit + function Unit:cargo_iterate() +return safe_iterate_list(private.Unit.cargo_list_head(self)) + end end -- *** ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31597 - in /trunk/data: amplio/ amplio2/ hex2t/ hexemplio/ isophex/ isotrident/ trident/
Author: jtn Date: Mon Jan 25 19:33:47 2016 New Revision: 31597 URL: http://svn.gna.org/viewcvs/freeciv?rev=31597&view=rev Log: Add basic graphics for goto turn steps, waypoints etc to all tilesets. See gna patch #5681. Modified: trunk/data/amplio/terrain1.png trunk/data/amplio/terrain1.spec trunk/data/amplio2/terrain1.png trunk/data/amplio2/terrain1.spec trunk/data/hex2t/tiles.png trunk/data/hex2t/tiles.spec trunk/data/hexemplio/terrain1.png trunk/data/hexemplio/terrain1.spec trunk/data/isophex/terrain1.png trunk/data/isophex/terrain1.spec trunk/data/isotrident/terrain1.png trunk/data/isotrident/terrain1.spec trunk/data/trident/tiles.png trunk/data/trident/tiles.spec Modified: trunk/data/amplio/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio/terrain1.png?rev=31597&r1=31596&r2=31597&view=diff == Binary files - no diff available. Modified: trunk/data/amplio/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio/terrain1.spec?rev=31597&r1=31596&r2=31597&view=diff == --- trunk/data/amplio/terrain1.spec (original) +++ trunk/data/amplio/terrain1.spec Mon Jan 25 19:33:47 2016 @@ -127,4 +127,10 @@ 15, 3, "t.blend.lake" 15, 4, "user.attention" 15, 5, "tx.fog" + +;goto path sprites + 14, 7, "path.exhausted_mp"; tip of path, no MP left + 15, 7, "path.normal" ; tip of path with MP remaining + 14, 8, "path.step"; turn boundary within path + 15, 8, "path.waypoint" } Modified: trunk/data/amplio2/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio2/terrain1.png?rev=31597&r1=31596&r2=31597&view=diff == Binary files - no diff available. Modified: trunk/data/amplio2/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/amplio2/terrain1.spec?rev=31597&r1=31596&r2=31597&view=diff == --- trunk/data/amplio2/terrain1.spec(original) +++ trunk/data/amplio2/terrain1.specMon Jan 25 19:33:47 2016 @@ -128,4 +128,10 @@ 15, 3, "t.blend.lake" 15, 4, "user.attention" 15, 5, "tx.fog" + +;goto path sprites + 14, 7, "path.exhausted_mp"; tip of path, no MP left + 15, 7, "path.normal" ; tip of path with MP remaining + 14, 8, "path.step"; turn boundary within path + 15, 8, "path.waypoint" } Modified: trunk/data/hex2t/tiles.png URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/hex2t/tiles.png?rev=31597&r1=31596&r2=31597&view=diff == Binary files - no diff available. Modified: trunk/data/hex2t/tiles.spec URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/hex2t/tiles.spec?rev=31597&r1=31596&r2=31597&view=diff == --- trunk/data/hex2t/tiles.spec (original) +++ trunk/data/hex2t/tiles.spec Mon Jan 25 19:33:47 2016 @@ -154,6 +154,12 @@ 8, 4, "tx.darkness_sw" 8, 5, "tx.darkness_w" +; goto path + + 8, 6, "path.step"; turn boundary within path + 8, 7, "path.exhausted_mp"; tip of path, no MP left + 8, 8, "path.normal" ; tip of path with MP remaining + 8, 9, "path.waypoint" } [grid_upkeep] Modified: trunk/data/hexemplio/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/hexemplio/terrain1.png?rev=31597&r1=31596&r2=31597&view=diff == Binary files - no diff available. Modified: trunk/data/hexemplio/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/hexemplio/terrain1.spec?rev=31597&r1=31596&r2=31597&view=diff == --- trunk/data/hexemplio/terrain1.spec (original) +++ trunk/data/hexemplio/terrain1.spec Mon Jan 25 19:33:47 2016 @@ -119,4 +119,10 @@ 5, 4, "user.attention" 5, 5, "tx.fog" 5, 8, "mask.tile" + +;goto path + 6, 0, "path.step"; turn boundary within path + 6, 1, "path.exhausted_mp"; tip of path, no MP left + 6, 2, "path.normal" ; tip of path with MP remaining + 6, 3, "path.waypoint" } Modified: trunk/data/isophex/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/isophex/terrain1.png?rev=31597&r1=31596&r2=31597&view=diff == Binary files - no diff available. Modified: trunk/data/isophex/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/isophex/terrain1.spec?rev=31597&r1=31596&r2=31597&view=diff == --- trunk/data/isophex/terrain1.spec(origin
[Freeciv-commits] r31595 - /trunk/data/scenarios/tutorial.sav
Author: jtn Date: Mon Jan 25 19:33:29 2016 New Revision: 31595 URL: http://svn.gna.org/viewcvs/freeciv?rev=31595&view=rev Log: Improvements to tutorial scenario: explain what to do with boats, and warn about killstack. See gna patch #2911. Modified: trunk/data/scenarios/tutorial.sav Modified: trunk/data/scenarios/tutorial.sav URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/scenarios/tutorial.sav?rev=31595&r1=31594&r2=31595&view=diff == --- trunk/data/scenarios/tutorial.sav (original) +++ trunk/data/scenarios/tutorial.sav Mon Jan 25 19:33:29 2016 @@ -3,7 +3,8 @@ is_scenario=TRUE game_version=20599 name=_("Tutorial") -description=_("Play this tutorial scenario to get an introduction to Freeciv.") +description=_("Play this tutorial scenario to get an introduction to Freeciv.\ + This is intended for single-player games.") save_random=FALSE players=TRUE startpos_nations=FALSE @@ -91,6 +92,11 @@ return (tile.terrain.id == find.terrain(terrain_name).id) end +-- TODO: +-- Hint to check science after building 1st city? +-- Words for first military unit? +-- Hint to build workers? + function turn_callback(turn, year) if turn == 0 then notify.event(nil, nil, E.SCRIPT, @@ -99,8 +105,36 @@ end signal.connect('turn_started', 'turn_callback') +-- Check for and warn about vulnerable stacks. +function check_stacks(tile, player) + if not vuln_stack_warning + and server.setting.get("killstack") == "ENABLED" + and not tile:city() and tile.terrain:class_name() == "Land" then +n_our_units = 0 +for unit in tile:units_iterate() do + if unit.owner == player + and unit:transporter() == nil then +n_our_units = n_our_units + 1 + end +end +-- Do not complain about 2 units, as that is a common defensive +-- formation: civilian plus bodyguard +if n_our_units >= 3 then + notify.event(player, tile, E.SCRIPT, +_("Outside of a city, if a 'stack' of units on a single tile is\n\ +attacked, the strongest unit defends; and if that unit is defeated,\n\ +ALL of the units on the tile are killed. Therefore, it's often a\n\ +good idea to spread units out, avoiding 'stacks' of units like this,\n\ +particularly on land.")) + vuln_stack_warning = true +end + end +end +vuln_stack_warning = false + function unit_moved_callback(unit, src_tile, dst_tile) if unit.owner:is_human() then +check_stacks(dst_tile, unit.owner) if citiesbuilt == 0 and has_unit_type_name(unit, 'Settlers') and (has_tile_terrain_name(dst_tile, 'Grassland') @@ -139,7 +173,7 @@ citypulses = citypulses + 1 else notify.event(city_builder, city_tile, E.SCRIPT, -_("You have built your third city! Your civilization seems to be\nthriving. It might be time to think about a military. Pick one of\nthe cities that has a high production, and convert it into a military\nbase. Build a Barracks there first, then start work on a military\nunit. Pick the best unit you have available - at the beginning of\nthe game, Warriors will be the only choice, but soon you will have \nplenty of options.\n\nThis might also be a good time to use the worklist feature of the\ncity dialog production report. Click on Barracks, then click Change\nto begin building them. Then double-click on a military unit to\nappend it to the worklist. As soon as the Barracks are complete the\ncity will automatically switch over to producing the unit.")) +_("You have built your third city! Your civilization seems to be\nthriving. It might be time to think about a military. Pick one of\nthe cities that has a high production, and turn it into a military\ncenter. Build a Barracks there first, then start work on a military\nunit. Pick the best unit you have available - at the beginning of\nthe game, Warriors will be the only choice, but soon you will have\nplenty of options.\n\nThis might also be a good time to use the worklist feature of the\ncity dialog production report. Click on Barracks, then click Change\nto begin building them. Then double-click on a military unit to\nappend it to the worklist. As soon as the Barracks are complete the\ncity will automatically switch over to producing the unit.")) signal.remove('pulse', 'third_city_pulse') end end @@ -189,7 +223,7 @@ if city.owner:is_human() then if size == 2 and not growth2msg then notify.event(city.owner, city.tile, E.SCRIPT, -_("Your city has grown! As a city grows, more citizens become\navailable that can be put to work in the fields or dedicated as\ncitizen specialists. A city with two citizens gets to work two\ndifferent tiles, in addition to its center tile which is worked\nfor free. In the city dialog, the map shows which tiles are worked\nand how much food, shields, and trade each provides. Food is used\nto grow your city, shields are used for production of buildings\nand units, whi
[Freeciv-commits] r31592 - /trunk/server/legacysave.c
Author: jtn Date: Mon Jan 25 19:33:18 2016 New Revision: 31592 URL: http://svn.gna.org/viewcvs/freeciv?rev=31592&view=rev Log: Correctly load fixed seeds from pre-2.3 scenarios. See gna bug #24340. Modified: trunk/server/legacysave.c Modified: trunk/server/legacysave.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/legacysave.c?rev=31592&r1=31591&r2=31592&view=diff == --- trunk/server/legacysave.c (original) +++ trunk/server/legacysave.c Mon Jan 25 19:33:18 2016 @@ -3618,8 +3618,8 @@ game.server.autoattack = secfile_lookup_bool_default(file, GAME_DEFAULT_AUTOATTACK, "game.autoattack"); -game.server.seed = - secfile_lookup_int_default(file, game.server.seed, +game.server.seed = game.server.seed_setting = + secfile_lookup_int_default(file, game.server.seed_setting, "game.randseed"); game.server.allowed_city_names = secfile_lookup_int_default(file, game.server.allowed_city_names, @@ -3763,9 +3763,10 @@ "map.generator"), "%s", secfile_error()); game.map.server.generator = ei; - fc_assert_exit_msg(secfile_lookup_int(file, &game.map.server.seed, + fc_assert_exit_msg(secfile_lookup_int(file, &game.map.server.seed_setting, "map.seed"), "%s", secfile_error()); + game.map.server.seed = game.map.server.seed_setting; fc_assert_exit_msg(secfile_lookup_int(file, &game.map.server.landpercent, "map.landpercent"), "%s", secfile_error()); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31601 - /branches/S2_6/data/scenarios/tutorial.sav
Author: jtn Date: Mon Jan 25 19:34:41 2016 New Revision: 31601 URL: http://svn.gna.org/viewcvs/freeciv?rev=31601&view=rev Log: Improvements to tutorial scenario: explain what to do with boats, and warn about killstack. See gna patch #2911. Modified: branches/S2_6/data/scenarios/tutorial.sav Modified: branches/S2_6/data/scenarios/tutorial.sav URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/scenarios/tutorial.sav?rev=31601&r1=31600&r2=31601&view=diff == --- branches/S2_6/data/scenarios/tutorial.sav (original) +++ branches/S2_6/data/scenarios/tutorial.sav Mon Jan 25 19:34:41 2016 @@ -3,7 +3,8 @@ is_scenario=TRUE game_version=20599 name=_("Tutorial") -description=_("Play this tutorial scenario to get an introduction to Freeciv.") +description=_("Play this tutorial scenario to get an introduction to Freeciv.\ + This is intended for single-player games.") save_random=FALSE players=TRUE startpos_nations=FALSE @@ -91,6 +92,11 @@ return (tile.terrain.id == find.terrain(terrain_name).id) end +-- TODO: +-- Hint to check science after building 1st city? +-- Words for first military unit? +-- Hint to build workers? + function turn_callback(turn, year) if turn == 0 then notify.event(nil, nil, E.SCRIPT, @@ -99,8 +105,38 @@ end signal.connect('turn_started', 'turn_callback') +-- Check for and warn about vulnerable stacks. +function check_stacks(tile, player) + if not vuln_stack_warning + and server.setting.get("killstack") == "ENABLED" + and not (tile:city() + or tile:has_base('Fortress') or tile:has_base('Airbase')) + and tile.terrain:class_name() == "Land" then +n_our_units = 0 +for unit in tile:units_iterate() do + if unit.owner == player + and unit:transporter() == nil then +n_our_units = n_our_units + 1 + end +end +-- Do not complain about 2 units, as that is a common defensive +-- formation: civilian plus bodyguard +if n_our_units >= 3 then + notify.event(player, tile, E.SCRIPT, +_("Outside of a city, or a fortress or airbase, if a 'stack' of units\n\ +on a single tile is attacked, the strongest unit defends; and if that\n\ +unit is defeated, ALL of the units on the tile are killed. Therefore,\n\ +it's often a good idea to spread units out, avoiding 'stacks' of units\n\ +like this, particularly on land.")) + vuln_stack_warning = true +end + end +end +vuln_stack_warning = false + function unit_moved_callback(unit, src_tile, dst_tile) if unit.owner:is_human() then +check_stacks(dst_tile, unit.owner) if citiesbuilt == 0 and has_unit_type_name(unit, 'Settlers') and (has_tile_terrain_name(dst_tile, 'Grassland') @@ -139,7 +175,7 @@ citypulses = citypulses + 1 else notify.event(city_builder, city_tile, E.SCRIPT, -_("You have built your third city! Your civilization seems to be\nthriving. It might be time to think about a military. Pick one of\nthe cities that has a high production, and convert it into a military\nbase. Build a Barracks there first, then start work on a military\nunit. Pick the best unit you have available - at the beginning of\nthe game, Warriors will be the only choice, but soon you will have \nplenty of options.\n\nThis might also be a good time to use the worklist feature of the\ncity dialog production report. Click on Barracks, then click Change\nto begin building them. Then double-click on a military unit to\nappend it to the worklist. As soon as the Barracks are complete the\ncity will automatically switch over to producing the unit.")) +_("You have built your third city! Your civilization seems to be\nthriving. It might be time to think about a military. Pick one of\nthe cities that has a high production, and turn it into a military\ncenter. Build a Barracks there first, then start work on a military\nunit. Pick the best unit you have available - at the beginning of\nthe game, Warriors will be the only choice, but soon you will have\nplenty of options.\n\nThis might also be a good time to use the worklist feature of the\ncity dialog production report. Click on Barracks, then click Change\nto begin building them. Then double-click on a military unit to\nappend it to the worklist. As soon as the Barracks are complete the\ncity will automatically switch over to producing the unit.")) signal.remove('pulse', 'third_city_pulse') end end @@ -193,7 +229,7 @@ growth2msg = true elseif size == 3 and not growth3msg then notify.event(city.owner, city.tile, E.SCRIPT, -_("Your city has grown again! Now with three citizens you have\na fair amount of choice over where the city should focus its\nresources. A city with three citizens gets to work three\ndifferent tiles, in addition to its center tile which is worked\nfor free. In the city dialog, the map shows which tiles are worked\nand how much fo
[Freeciv-commits] r31600 - in /branches/S2_6/common/scriptcore: api_game_methods.c api_game_methods.h tolua_game.pkg
Author: jtn Date: Mon Jan 25 19:34:37 2016 New Revision: 31600 URL: http://svn.gna.org/viewcvs/freeciv?rev=31600&view=rev Log: Lua: add Unit:transporter(), Unit:cargo_iterate(). See gna patch #6845. Modified: branches/S2_6/common/scriptcore/api_game_methods.c branches/S2_6/common/scriptcore/api_game_methods.h branches/S2_6/common/scriptcore/tolua_game.pkg Modified: branches/S2_6/common/scriptcore/api_game_methods.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/scriptcore/api_game_methods.c?rev=31600&r1=31599&r2=31600&view=diff == --- branches/S2_6/common/scriptcore/api_game_methods.c (original) +++ branches/S2_6/common/scriptcore/api_game_methods.c Mon Jan 25 19:34:37 2016 @@ -880,6 +880,28 @@ } /* + Return Unit that transports punit, if any. +*/ +Unit *api_methods_unit_transporter(lua_State *L, Unit *punit) +{ + LUASCRIPT_CHECK_STATE(L, NULL); + LUASCRIPT_CHECK_SELF(L, punit, NULL); + + return punit->transporter; +} + +/* + Return list head for cargo list for Unit +*/ +Unit_List_Link *api_methods_private_unit_cargo_list_head(lua_State *L, + Unit *punit) +{ + LUASCRIPT_CHECK_STATE(L, NULL); + LUASCRIPT_CHECK_SELF(L, punit, NULL); + return unit_list_head(punit->transporting); +} + +/* Return TRUE if punit_type has flag. */ bool api_methods_unit_type_has_flag(lua_State *L, Unit_Type *punit_type, Modified: branches/S2_6/common/scriptcore/api_game_methods.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/scriptcore/api_game_methods.h?rev=31600&r1=31599&r2=31600&view=diff == --- branches/S2_6/common/scriptcore/api_game_methods.h (original) +++ branches/S2_6/common/scriptcore/api_game_methods.h Mon Jan 25 19:34:37 2016 @@ -138,6 +138,9 @@ bool api_methods_unit_city_can_be_built_here(lua_State *L, Unit *punit); Tile *api_methods_unit_tile_get(lua_State *L, Unit * punit); Direction api_methods_unit_orientation_get(lua_State *L, Unit *punit); +Unit *api_methods_unit_transporter(lua_State *L, Unit *punit); +Unit_List_Link *api_methods_private_unit_cargo_list_head(lua_State *L, + Unit *punit); /* Unit Type */ bool api_methods_unit_type_has_flag(lua_State *L, Unit_Type *punit_type, Modified: branches/S2_6/common/scriptcore/tolua_game.pkg URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/scriptcore/tolua_game.pkg?rev=31600&r1=31599&r2=31600&view=diff == --- branches/S2_6/common/scriptcore/tolua_game.pkg (original) +++ branches/S2_6/common/scriptcore/tolua_game.pkg Mon Jan 25 19:34:37 2016 @@ -214,10 +214,19 @@ @ tile(lua_State *L, Unit *self); } + Unit *api_methods_unit_transporter +@ transporter (lua_State *L, Unit *self); bool api_methods_unit_city_can_be_built_here @ is_on_possible_city_tile (lua_State *L, Unit *self); Direction api_methods_unit_orientation_get @ facing(lua_State *L, Unit *self); +} + +module methods_private { + module Unit { +Unit_List_Link *api_methods_private_unit_cargo_list_head + @ cargo_list_head (lua_State *L, Unit *self); + } } $[ @@ -534,6 +543,11 @@ function Tile:units_iterate() return safe_iterate_list(private.Tile.unit_list_head(self)) end + + -- Safe iteration over the units transported by Unit + function Unit:cargo_iterate() +return safe_iterate_list(private.Unit.cargo_list_head(self)) + end end -- *** ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31599 - /branches/S2_6/server/srv_main.c
Author: jtn Date: Mon Jan 25 19:34:34 2016 New Revision: 31599 URL: http://svn.gna.org/viewcvs/freeciv?rev=31599&view=rev Log: Update map retry after bug #24319 introduced seed_setting. A failing player-specified mapseed is no longer pointlessly retried. See gna bug #24341. Modified: branches/S2_6/server/srv_main.c Modified: branches/S2_6/server/srv_main.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/srv_main.c?rev=31599&r1=31598&r2=31599&view=diff == --- branches/S2_6/server/srv_main.c (original) +++ branches/S2_6/server/srv_main.c Mon Jan 25 19:34:34 2016 @@ -2876,7 +2876,9 @@ { "teamplacement", } }; int i; -bool retry_ok = (game.map.server.seed == 0 +/* If a specific seed has been requested, there's no point retrying, + * as the map will be the same every time. */ +bool retry_ok = (game.map.server.seed_setting == 0 && game.map.server.generator != MAPGEN_SCENARIO); int max = retry_ok ? 3 : 1; bool created = FALSE; @@ -2911,6 +2913,9 @@ if (!created && max > 1) { int set; +/* If we're retrying, seed_setting==0, which will yield a new map + * next time */ +fc_assert(game.map.server.seed_setting == 0); if (i == 0) { /* We will retry only if max attempts allow it */ log_normal(_("Failed to create suitable map, retrying with another mapseed.")); @@ -2921,8 +2926,6 @@ * +2 */ log_normal(_("Attempt %d/%d"), i + 2, max); } -/* Reset mapseed so generator knows to use new one */ -game.map.server.seed = 0; /* One should never set this to false in scenario map that had resources * placed. We are safe side here as map generation is retried only if this is * not scenario map at all. */ ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31603 - in /branches/S2_6/data: amplio/ amplio2/ hex2t/ hexemplio/ isophex/ isotrident/ trident/
Author: jtn Date: Mon Jan 25 19:35:00 2016 New Revision: 31603 URL: http://svn.gna.org/viewcvs/freeciv?rev=31603&view=rev Log: Add basic graphics for goto turn steps, waypoints etc to all tilesets. See gna patch #5681. Modified: branches/S2_6/data/amplio/terrain1.png branches/S2_6/data/amplio/terrain1.spec branches/S2_6/data/amplio2/terrain1.png branches/S2_6/data/amplio2/terrain1.spec branches/S2_6/data/hex2t/tiles.png branches/S2_6/data/hex2t/tiles.spec branches/S2_6/data/hexemplio/terrain1.png branches/S2_6/data/hexemplio/terrain1.spec branches/S2_6/data/isophex/terrain1.png branches/S2_6/data/isophex/terrain1.spec branches/S2_6/data/isotrident/terrain1.png branches/S2_6/data/isotrident/terrain1.spec branches/S2_6/data/trident/tiles.png branches/S2_6/data/trident/tiles.spec Modified: branches/S2_6/data/amplio/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/amplio/terrain1.png?rev=31603&r1=31602&r2=31603&view=diff == Binary files - no diff available. Modified: branches/S2_6/data/amplio/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/amplio/terrain1.spec?rev=31603&r1=31602&r2=31603&view=diff == --- branches/S2_6/data/amplio/terrain1.spec (original) +++ branches/S2_6/data/amplio/terrain1.spec Mon Jan 25 19:35:00 2016 @@ -127,4 +127,10 @@ 15, 3, "t.blend.lake" 15, 4, "user.attention" 15, 5, "tx.fog" + +;goto path sprites + 14, 7, "path.exhausted_mp"; tip of path, no MP left + 15, 7, "path.normal" ; tip of path with MP remaining + 14, 8, "path.step"; turn boundary within path + 15, 8, "path.waypoint" } Modified: branches/S2_6/data/amplio2/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/amplio2/terrain1.png?rev=31603&r1=31602&r2=31603&view=diff == Binary files - no diff available. Modified: branches/S2_6/data/amplio2/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/amplio2/terrain1.spec?rev=31603&r1=31602&r2=31603&view=diff == --- branches/S2_6/data/amplio2/terrain1.spec(original) +++ branches/S2_6/data/amplio2/terrain1.specMon Jan 25 19:35:00 2016 @@ -128,4 +128,10 @@ 15, 3, "t.blend.lake" 15, 4, "user.attention" 15, 5, "tx.fog" + +;goto path sprites + 14, 7, "path.exhausted_mp"; tip of path, no MP left + 15, 7, "path.normal" ; tip of path with MP remaining + 14, 8, "path.step"; turn boundary within path + 15, 8, "path.waypoint" } Modified: branches/S2_6/data/hex2t/tiles.png URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/hex2t/tiles.png?rev=31603&r1=31602&r2=31603&view=diff == Binary files - no diff available. Modified: branches/S2_6/data/hex2t/tiles.spec URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/hex2t/tiles.spec?rev=31603&r1=31602&r2=31603&view=diff == --- branches/S2_6/data/hex2t/tiles.spec (original) +++ branches/S2_6/data/hex2t/tiles.spec Mon Jan 25 19:35:00 2016 @@ -154,6 +154,12 @@ 8, 4, "tx.darkness_sw" 8, 5, "tx.darkness_w" +; goto path + + 8, 6, "path.step"; turn boundary within path + 8, 7, "path.exhausted_mp"; tip of path, no MP left + 8, 8, "path.normal" ; tip of path with MP remaining + 8, 9, "path.waypoint" } [grid_upkeep] Modified: branches/S2_6/data/hexemplio/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/hexemplio/terrain1.png?rev=31603&r1=31602&r2=31603&view=diff == Binary files - no diff available. Modified: branches/S2_6/data/hexemplio/terrain1.spec URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/hexemplio/terrain1.spec?rev=31603&r1=31602&r2=31603&view=diff == --- branches/S2_6/data/hexemplio/terrain1.spec (original) +++ branches/S2_6/data/hexemplio/terrain1.spec Mon Jan 25 19:35:00 2016 @@ -119,4 +119,10 @@ 5, 4, "user.attention" 5, 5, "tx.fog" 5, 8, "mask.tile" + +;goto path + 6, 0, "path.step"; turn boundary within path + 6, 1, "path.exhausted_mp"; tip of path, no MP left + 6, 2, "path.normal" ; tip of path with MP remaining + 6, 3, "path.waypoint" } Modified: branches/S2_6/data/isophex/terrain1.png URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/isophex/terrain1.png?rev=31603&r1=31602&r2=31603&view=diff ===
[Freeciv-commits] r31602 - /branches/S2_6/client/tilespec.c
Author: jtn Date: Mon Jan 25 19:34:44 2016 New Revision: 31602 URL: http://svn.gna.org/viewcvs/freeciv?rev=31602&view=rev Log: Don't draw goto state sprites with fog. See gna bug #24342. Modified: branches/S2_6/client/tilespec.c Modified: branches/S2_6/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=31602&r1=31601&r2=31602&view=diff == --- branches/S2_6/client/tilespec.c (original) +++ branches/S2_6/client/tilespec.c Mon Jan 25 19:34:44 2016 @@ -4998,7 +4998,7 @@ sprite = t->sprites.path.s[state].specific; if (sprite != NULL) { -ADD_SPRITE_SIMPLE(sprite); +ADD_SPRITE(sprite, FALSE, 0, 0); } sprite = t->sprites.path.s[state].turns[length % 10]; @@ -5023,7 +5023,7 @@ } if (waypoint) { - ADD_SPRITE_SIMPLE(t->sprites.path.waypoint); + ADD_SPRITE(t->sprites.path.waypoint, FALSE, 0, 0); } if (warn) { ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31598 - /branches/S2_6/server/savegame.c
Author: jtn Date: Mon Jan 25 19:34:31 2016 New Revision: 31598 URL: http://svn.gna.org/viewcvs/freeciv?rev=31598&view=rev Log: Correctly load fixed seeds from pre-2.3 scenarios. See gna bug #24340. Modified: branches/S2_6/server/savegame.c Modified: branches/S2_6/server/savegame.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savegame.c?rev=31598&r1=31597&r2=31598&view=diff == --- branches/S2_6/server/savegame.c (original) +++ branches/S2_6/server/savegame.c Mon Jan 25 19:34:31 2016 @@ -3586,8 +3586,8 @@ game.server.autoattack = secfile_lookup_bool_default(file, GAME_DEFAULT_AUTOATTACK, "game.autoattack"); -game.server.seed = - secfile_lookup_int_default(file, game.server.seed, +game.server.seed = game.server.seed_setting = + secfile_lookup_int_default(file, game.server.seed_setting, "game.randseed"); game.server.allowed_city_names = secfile_lookup_int_default(file, game.server.allowed_city_names, @@ -3731,9 +3731,10 @@ "map.generator"), "%s", secfile_error()); game.map.server.generator = ei; - fc_assert_exit_msg(secfile_lookup_int(file, &game.map.server.seed, + fc_assert_exit_msg(secfile_lookup_int(file, &game.map.server.seed_setting, "map.seed"), "%s", secfile_error()); + game.map.server.seed = game.map.server.seed_setting; fc_assert_exit_msg(secfile_lookup_int(file, &game.map.server.landpercent, "map.landpercent"), "%s", secfile_error()); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r31604 - /branches/S2_5/data/scenarios/tutorial.sav
Author: jtn Date: Mon Jan 25 19:35:35 2016 New Revision: 31604 URL: http://svn.gna.org/viewcvs/freeciv?rev=31604&view=rev Log: Improvements to tutorial scenario: explain what to do with boats, and warn about killstack. See gna patch #2911. Modified: branches/S2_5/data/scenarios/tutorial.sav Modified: branches/S2_5/data/scenarios/tutorial.sav URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/data/scenarios/tutorial.sav?rev=31604&r1=31603&r2=31604&view=diff == --- branches/S2_5/data/scenarios/tutorial.sav (original) +++ branches/S2_5/data/scenarios/tutorial.sav Mon Jan 25 19:35:35 2016 @@ -2,7 +2,8 @@ [scenario] is_scenario=TRUE name=_("Tutorial") -description=_("Play this tutorial scenario to get an introduction to Freeciv.") +description=_("Play this tutorial scenario to get an introduction to Freeciv.\ + This is intended for single-player games.") [savefile] options=" +version2" @@ -65,6 +66,11 @@ return (tile.terrain.id == find.terrain(terrain_name).id) end +-- TODO: +-- Hint to check science after building 1st city? +-- Words for first military unit? +-- Hint to build workers? + function turn_callback(turn, year) if turn == 0 then notify.event(nil, nil, E.SCRIPT, @@ -73,8 +79,36 @@ end signal.connect('turn_started', 'turn_callback') +-- Check for and warn about vulnerable stacks. +function check_stacks(tile, player) + if not vuln_stack_warning + and server.setting.get("killstack") == "ENABLED" + and not (tile:city() + or tile:has_base('Fortress') or tile:has_base('Airbase')) then +n_our_units = 0 +for unit in tile:units_iterate() do + if unit.owner == player then +n_our_units = n_our_units + 1 + end +end +-- Do not complain about 2 units, as that is a common defensive +-- formation: civilian plus bodyguard +if n_our_units >= 3 then + notify.event(player, tile, E.SCRIPT, +_("Outside of a city, or a fortress or airbase, if a 'stack' of units\n\ +on a single tile is attacked, the strongest unit defends; and if that\n\ +unit is defeated, ALL of the units on the tile are killed. Therefore,\n\ +it's often a good idea to spread units out, avoiding 'stacks' of units\n\ +like this, particularly on land.")) + vuln_stack_warning = true +end + end +end +vuln_stack_warning = false + function unit_moved_callback(unit, src_tile, dst_tile) if unit.owner:is_human() then +check_stacks(dst_tile, unit.owner) if citiesbuilt == 0 and has_unit_type_name(unit, 'Settlers') and (has_tile_terrain_name(dst_tile, 'Grassland') @@ -96,7 +130,7 @@ _("Congratulations, you have founded your second city. This city will\nbehave almost exactly like the first one - it will be slightly different\nbecause of the terrain around it. You probably want to build\nsettlers here too.")) elseif citiesbuilt == 2 then notify.event(city.owner, city.tile, E.SCRIPT, -_("You have built your third city! Your civilization seems to be\nthriving. It might be time to think about a military. Pick one of\nthe cities that has a high production, and convert it into a military\nbase. Build a Barracks there first, then start work on a military\nunit. Pick the best unit you have available - at the beginning of\nthe game, Warriors will be the only choice, but soon you will have \nplenty of options.\n\nThis might also be a good time to use the worklist feature of the\ncity dialog production report. Click on Barracks, then click Change\nto begin building them. Then double-click on a military unit to\nappend it to the worklist. As soon as the Barracks are complete the\ncity will automatically switch over to producing the unit.")) +_("You have built your third city! Your civilization seems to be\nthriving. It might be time to think about a military. Pick one of\nthe cities that has a high production, and turn it into a military\ncenter. Build a Barracks there first, then start work on a military\nunit. Pick the best unit you have available - at the beginning of\nthe game, Warriors will be the only choice, but soon you will have\nplenty of options.\n\nThis might also be a good time to use the worklist feature of the\ncity dialog production report. Click on Barracks, then click Change\nto begin building them. Then double-click on a military unit to\nappend it to the worklist. As soon as the Barracks are complete the\ncity will automatically switch over to producing the unit.")) elseif citiesbuilt == 3 then notify.event(city.owner, city.tile, E.SCRIPT, _("Another city! You are really getting the hang of this. You\nprobably have a pretty good idea what to do with new cities by\nnow. Take a moment to look at the bar below the city on the map\nview. This display shows some useful information about the city.\nThe flag and background color indicate what civilization the city\nbelongs to (t
[Freeciv-commits] r31605 - in /branches/S2_6/win32: installer/Makefile installer_msys2/Makefile
Author: cazfi Date: Tue Jan 26 06:39:45 2016 New Revision: 31605 URL: http://svn.gna.org/viewcvs/freeciv?rev=31605&view=rev Log: Made Vista the minimum requirement for Windows Installer builds so that we get getaddrinfo() to use. See patch #6818 Modified: branches/S2_6/win32/installer/Makefile branches/S2_6/win32/installer_msys2/Makefile Modified: branches/S2_6/win32/installer/Makefile URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/win32/installer/Makefile?rev=31605&r1=31604&r2=31605&view=diff == --- branches/S2_6/win32/installer/Makefile (original) +++ branches/S2_6/win32/installer/Makefile Tue Jan 26 06:39:45 2016 @@ -54,7 +54,7 @@ # create build directory mkdir -p build-$(GUI) # configure - cd build-$(GUI); ../../../configure --enable-client=$(GUI) --with-followtag="win32-S2_6" --enable-fcdb=sqlite3 --enable-fcmp=$(FCMP) $(EXTRA_CONFIG) + cd build-$(GUI); ../../../configure CPPFLAGS="-D_WIN32_WINNT=0x0600" --enable-client=$(GUI) --with-followtag="win32-S2_6" --enable-fcdb=sqlite3 --enable-fcmp=$(FCMP) $(EXTRA_CONFIG) # make make -C build-$(GUI) make -C build-$(GUI)/translations/freeciv update-po @@ -64,7 +64,7 @@ # create build directory mkdir -p build-ruledit # configure - cd build-ruledit; ../../../configure --disable-client --disable-server --disable-fcmp --disable-freeciv-manual + cd build-ruledit; ../../../configure CPPFLAGS="-D_WIN32_WINNT=0x0600" --disable-client --disable-server --disable-fcmp --disable-freeciv-manual # make make -C build-ruledit make -C build-ruledit/translations/ruledit update-po Modified: branches/S2_6/win32/installer_msys2/Makefile URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/win32/installer_msys2/Makefile?rev=31605&r1=31604&r2=31605&view=diff == --- branches/S2_6/win32/installer_msys2/Makefile(original) +++ branches/S2_6/win32/installer_msys2/MakefileTue Jan 26 06:39:45 2016 @@ -37,7 +37,7 @@ # create build directory mkdir -p build-$(GUI) # configure - cd build-$(GUI); ../../../configure --enable-client=$(GUI) --with-followtag="win32-S2_6" --enable-fcdb=sqlite3 --enable-fcmp=$(FCMP) $(EXTRA_CONFIG) + cd build-$(GUI); ../../../configure CPPFLAGS="-D_WIN32_WINNT=0x0600" --enable-client=$(GUI) --with-followtag="win32-S2_6" --enable-fcdb=sqlite3 --enable-fcmp=$(FCMP) $(EXTRA_CONFIG) # make make -C build-$(GUI) make -C build-$(GUI)/translations/freeciv update-po @@ -47,7 +47,7 @@ # create build directory mkdir -p build-ruledit # configure - cd build-ruledit; ../../../configure --disable-client --disable-server --disable-fcmp --disable-freeciv-manual + cd build-ruledit; ../../../configure CPPFLAGS="-D_WIN32_WINNT=0x0600" --disable-client --disable-server --disable-fcmp --disable-freeciv-manual # make make -C build-ruledit make -C build-ruledit/translations/ruledit update-po ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits