[Freeciv-Dev] (PR#6944) repodlg.c: showing only 11-step-reachable techs
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6944 >
> [jdorje - Sun Nov 30 19:21:40 2003]:
>
> Eugeny Korekin wrote:
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=6944 >
>
> > I think, goals defined in nations' tech_goals options should
> > be visible always, no matter how many steps it takes to achieve
> > these techs. For example, there is ancients modpack, in which
> > romans has tech_goal Republic, but it cannot be seen in science
> > dialog, and player wrongly thought, that current goal is Academy
> > (first tech in alphabetically sorted list),
>
> So the bug is that the player's goal is republic, but he isn't able to
> see that since it's too far down the tree. Instead he thinks some other
> tech is his goal. That is a bug, and should be fixed.
>
> Don't look at the nations' tech_goals values, though - look at the
> current tech goal. This goal should be included in the list even if
> it's beyond the limit of 11.
And a patch.
jason
Index: client/gui-gtk/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/repodlgs.c,v
retrieving revision 1.76
diff -u -r1.76 repodlgs.c
--- client/gui-gtk/repodlgs.c 2003/11/28 17:37:19 1.76
+++ client/gui-gtk/repodlgs.c 2004/01/31 06:21:18
@@ -506,7 +506,8 @@
if (tech_is_available(game.player_ptr, i)
&& get_invention(game.player_ptr, i) != TECH_KNOWN
&& advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
- && num_unknown_techs_for_goal(game.player_ptr, i) < 11) {
+ && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
+ || i == game.player_ptr->ai.tech_goal)) {
if (i==game.player_ptr->ai.tech_goal)
hist=i;
sorting_list = g_list_append(sorting_list, GINT_TO_POINTER(i));
Index: client/gui-gtk-2.0/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.c,v
retrieving revision 1.39
diff -u -r1.39 repodlgs.c
--- client/gui-gtk-2.0/repodlgs.c 2004/01/26 19:09:09 1.39
+++ client/gui-gtk-2.0/repodlgs.c 2004/01/31 06:21:18
@@ -524,7 +524,8 @@
if (tech_is_available(game.player_ptr, i)
&& get_invention(game.player_ptr, i) != TECH_KNOWN
&& advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
- && num_unknown_techs_for_goal(game.player_ptr, i) < 11) {
+ && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
+ || i == game.player_ptr->ai.tech_goal)) {
if (i==game.player_ptr->ai.tech_goal)
hist=i;
sorting_list = g_list_append(sorting_list, GINT_TO_POINTER(i));
Index: client/gui-sdl/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/repodlgs.c,v
retrieving revision 1.33
diff -u -r1.33 repodlgs.c
--- client/gui-sdl/repodlgs.c 2004/01/05 00:18:30 1.33
+++ client/gui-sdl/repodlgs.c 2004/01/31 06:21:19
@@ -2990,7 +2990,8 @@
if (tech_is_available(game.player_ptr, i)
&& get_invention(game.player_ptr, i) != TECH_KNOWN
&& advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
- && num_unknown_techs_for_goal(game.player_ptr, i) < 11) {
+ && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
+ || i == game.player_ptr->ai.tech_goal)) {
count++;
}
}
@@ -3059,7 +3060,8 @@
if (tech_is_available(game.player_ptr, i)
&& get_invention(game.player_ptr, i) != TECH_KNOWN
&& advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
- && (num = num_unknown_techs_for_goal(game.player_ptr, i)) < 11) {
+ && ((num = num_unknown_techs_for_goal(game.player_ptr, i)) < 11
+ || i == game.player_ptr->ai.tech_goal)) {
count++;
my_snprintf(cBuf, sizeof(cBuf), "%s\n%d %s", advances[i].name, num,
Index: client/gui-win32/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/repodlgs.c,v
retrieving revision 1.32
diff -u -r1.32 repodlgs.c
--- client/gui-win32/repodlgs.c 2003/12/06 23:14:34 1.32
+++ client/gui-win32/repodlgs.c 2004/01/31 06:21:19
@@ -147,7 +147,8 @@
if (tech_is_available(game.player_ptr, i)
&& get_invention(game.player_ptr, i) != TECH_KNOWN
&& advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
- && num_unknown_techs_for_goal(game.player_ptr, i) < 11) {
+ && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
+ || i == game.player_ptr->ai.tech_goal)) {
id=ComboBox_AddString(GetDlgItem(science_dlg,ID_SCIENCE_GOAL),
advances[i].name);
ComboBox_SetItemData(GetDlgItem(science_dlg,ID_SCIENCE_GOAL),
Index: client/gui-xaw/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/repodlgs.c,v
retrieving revision 1.53
diff -u -r1.53 repodlgs.c
--- client/gui-xaw/repodlgs.c 2003/11/28 17:37:20 1.53
+++ client/gui-xaw/repodlgs.c 2004/01/31 06:21:19
@@ -335,7 +335,8 @@
if (tech_is_available(game.player_ptr, i)
&& get_invention(game.player_ptr, i) != TECH_KNOWN
&& advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
- && num_unknown_techs_for_goal(game.player_ptr, i) < 11) {
+ && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
+ || i == game.player_ptr->ai.tech_goal) {
Widget entry=
XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass,
goalmenu, NULL);
@@ -543,9 +544,11 @@
NULL);
for(i=A_FIRST, flag=0; i<game.num_tech_types; i++)
- if(get_invention(game.player_ptr, i) != TECH_KNOWN &&
- advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST &&
- num_unknown_techs_for_goal(game.player_ptr, i) < 11) {
+ if (tech_is_available(game.player_ptr, i)
+ && get_invention(game.player_ptr, i) != TECH_KNOWN
+ && advances[i].req[0] != A_LAST && advances[i].req[1] != A_LAST
+ && (num_unknown_techs_for_goal(game.player_ptr, i) < 11
+ || i == game.player_ptr->ai.tech_goal)) {
Widget entry=
XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass,
goalmenu, NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#6944) repodlg.c: showing only 11-step-reachable techs,
Jason Short <=
|
|