[Freeciv-Dev] (PR#9398) GUI airlift improvements
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] (PR#9398) GUI airlift improvements |
From: |
"Jason Dorje Short" <jdorje@xxxxxxxxxxx> |
Date: |
Thu, 15 Jul 2004 19:39:41 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9398 >
Currently the GUI code checks if a city can be airlifted to by checking
if the airport improvement is "active".
I don't really know what this means but I know it doesn't work with
gen-eff. This patch instead checks the pcity->airlift value. This
value is TRUE for cities with airports who have not airlifted (sending
or receiving) this turn.
It would be much much better to call unit_can_airlift_to but in most
cases (GUI code being ugly and all) we don't know the unit. The current
behavior (which isn't fixed by this patch) labels cities as
airliftable even if the unit isn't inside a city.
Another futuristic alternative is to have goto routes automatically take
advantage of airlifting. The big problem here is that multiple units
may try to airlift through the same city on the same turn.
jason
Index: client/gui-gtk/gotodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gotodlg.c,v
retrieving revision 1.22
diff -u -r1.22 gotodlg.c
--- client/gui-gtk/gotodlg.c 4 Apr 2003 15:47:46 -0000 1.22
+++ client/gui-gtk/gotodlg.c 16 Jul 2004 02:39:04 -0000
@@ -198,8 +198,10 @@
if(!all_cities && i!=game.player_idx) continue;
city_list_iterate(game.players[i].cities, pcity) {
sz_strlcpy(name, pcity->name);
- if (pcity->improvements[B_AIRPORT] == I_ACTIVE)
+ /* FIXME: should use unit_can_airlift_to(). */
+ if (pcity->airlift) {
sz_strlcat(name, "(A)");
+ }
gtk_clist_append( GTK_CLIST( goto_list ), row );
}
city_list_iterate_end;
Index: client/gui-gtk-2.0/gotodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gotodlg.c,v
retrieving revision 1.12
diff -u -r1.12 gotodlg.c
--- client/gui-gtk-2.0/gotodlg.c 1 May 2004 17:28:47 -0000 1.12
+++ client/gui-gtk-2.0/gotodlg.c 16 Jul 2004 02:39:04 -0000
@@ -253,10 +253,8 @@
city_list_iterate(game.players[i].cities, pcity) {
gtk_list_store_append(store, &it);
- gtk_list_store_set(store, &it,
- 0, pcity->name,
- 1, (pcity->improvements[B_AIRPORT] == I_ACTIVE),
- -1);
+ /* FIXME: should use unit_can_airlift_to(). */
+ gtk_list_store_set(store, &it, 0, pcity->name, 1, pcity->airlift, -1);
}
city_list_iterate_end;
}
Index: client/gui-mui/gotodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/gotodlg.c,v
retrieving revision 1.12
diff -u -r1.12 gotodlg.c
--- client/gui-mui/gotodlg.c 14 Nov 2002 09:14:56 -0000 1.12
+++ client/gui-mui/gotodlg.c 16 Jul 2004 02:39:04 -0000
@@ -58,8 +58,10 @@
{
static char name[80];
sz_strlcpy(name, pcity->name);
- if (pcity->improvements[B_AIRPORT] == I_ACTIVE)
+ /* FIXME: should use unit_can_airlift_to(). */
+ if (pcity->airlift) {
sz_strlcat(name, "(A)");
+ }
*array = name;
}
Index: client/gui-sdl/gotodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-sdl/gotodlg.c,v
retrieving revision 1.7
diff -u -r1.7 gotodlg.c
--- client/gui-sdl/gotodlg.c 2 Oct 2003 21:37:44 -0000 1.7
+++ client/gui-sdl/gotodlg.c 16 Jul 2004 02:39:05 -0000
@@ -122,7 +122,8 @@
city_list_iterate(game.players[i].cities, pCity) {
- if(!GOTO && !city_got_building(pCity, B_AIRPORT)) {
+ /* FIXME: should use unit_can_airlift_to(). */
+ if (!GOTO && !pcity->airlift) {
continue;
}
Index: client/gui-win32/gotodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/gotodlg.c,v
retrieving revision 1.7
diff -u -r1.7 gotodlg.c
--- client/gui-win32/gotodlg.c 1 Jan 2003 11:51:34 -0000 1.7
+++ client/gui-win32/gotodlg.c 16 Jul 2004 02:39:05 -0000
@@ -189,8 +189,10 @@
if(!show_all_cities && i!=game.player_idx) continue;
city_list_iterate(game.players[i].cities, pcity) {
sz_strlcpy(name, pcity->name);
- if (pcity->improvements[B_AIRPORT] == I_ACTIVE)
+ /* FIXME: should use unit_can_airlift_to(). */
+ if (pcity->airlift) {
sz_strlcat(name, "(A)");
+ }
j=ListBox_AddString(list,name);
ListBox_SetItemData(list,j,pcity->id);
}
Index: client/gui-xaw/gotodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/gotodlg.c,v
retrieving revision 1.21
diff -u -r1.21 gotodlg.c
--- client/gui-xaw/gotodlg.c 1 Jan 2003 11:51:34 -0000 1.21
+++ client/gui-xaw/gotodlg.c 16 Jul 2004 02:39:05 -0000
@@ -223,8 +223,10 @@
city_list_iterate(game.players[i].cities, pcity) {
char name[MAX_LEN_NAME+3];
sz_strlcpy(name, pcity->name);
- if (pcity->improvements[B_AIRPORT] == I_ACTIVE)
+ /* FIXME: should use unit_can_airlift_to(). */
+ if (pcity->airlift) {
sz_strlcat(name, "(A)");
+ }
city_name_ptrs[j++]=mystrdup(name);
}
city_list_iterate_end;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#9398) GUI airlift improvements,
Jason Dorje Short <=
|
|