[Freeciv-Dev] (PR#34047) glitch in aneglus' GTK theme

2007-01-18 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=34047 >

Aneglus' custom GTK theme for Freeciv is looking great, but it has a
serious glitch as seen in attached screenshot.

I have been in contact with the author, but he has yet to come up with
a solution. The big question is, is this a bug in the theme, in
Freeciv, or in GTK?

http://forum.freeciv.org/viewtopic.php?t=1636


 ~Daniel

<>
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#34032) wishlist: further cripple novice AI

2007-01-18 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=34032 >

On 1/19/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
> http://bugs.freeciv.org/Ticket/Display.html?id=34032 >
>
> On 1/19/07, Daniel Markstedt <[EMAIL PROTECTED]> wrote:
> > I suggest we cripple "novice" further so that it becomes what players
> > expect it to be: something that even a novice can stand a chance
> > against. It should build sparser empires, expand less overseas and be
> > less militarily aggressive.
>
>  We want it to perform badly, not to have rules changed against it. Or?
>
>  About changing rules, attached is untested patch that halves
> firepower for novice AI.
>
>
>  - ML
>

For the best effect, there should IMO be a combination of the two!

This patch is a good start; what about a similar effect on research?

 ~Daniel



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#34032) wishlist: further cripple novice AI

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=34032 >

On 1/19/07, Daniel Markstedt <[EMAIL PROTECTED]> wrote:
> I suggest we cripple "novice" further so that it becomes what players
> expect it to be: something that even a novice can stand a chance
> against. It should build sparser empires, expand less overseas and be
> less militarily aggressive.

 We want it to perform badly, not to have rules changed against it. Or?

 About changing rules, attached is untested patch that halves
firepower for novice AI.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/combat.c freeciv/common/combat.c
--- freeciv/common/combat.c	2007-01-19 03:51:15.0 +0200
+++ freeciv/common/combat.c	2007-01-19 04:49:38.0 +0200
@@ -245,6 +245,8 @@
 			int *att_fp, int *def_fp)
 {
   struct city *pcity = tile_get_city(defender->tile);
+  struct player *att_owner;
+  struct player *def_owner;
 
   *att_fp = unit_type(attacker)->firepower;
   *def_fp = unit_type(defender)->firepower;
@@ -283,6 +285,20 @@
 *att_fp = 1;
 *def_fp = 1;
   }
+
+  att_owner = unit_owner(attacker);
+  def_owner = unit_owner(defender);
+
+  if (*att_fp > 1
+  && att_owner->ai.control
+  && ai_handicap(att_owner, H_FIREPOWER)) {
+*att_fp /= 2;
+  }
+  if (*def_fp > 1
+  && def_owner->ai.control
+  && ai_handicap(def_owner, H_FIREPOWER)) {
+*def_fp /= 2;
+  }
 }
 
 /**
diff -Nurd -X.diff_ignore freeciv/common/player.h freeciv/common/player.h
--- freeciv/common/player.h	2006-07-17 23:56:46.0 +0300
+++ freeciv/common/player.h	2007-01-19 04:48:16.0 +0200
@@ -55,7 +55,8 @@
   H_MAP = 1024,   /* Only knows map_is_known tiles */
   H_DIPLOMACY = 2048, /* Not very good at diplomacy */
   H_REVOLUTION = 4096, /* Cannot skip anarchy */
-  H_EXPANSION = 8192 /* Don't like being much larger than human */
+  H_EXPANSION = 8192, /* Don't like being much larger than human */
+  H_FIREPOWER = 16384 /* Reduced firepower */
 };
 
 BV_DEFINE(bv_player, MAX_NUM_PLAYERS + MAX_NUM_BARBARIANS);
diff -Nurd -X.diff_ignore freeciv/server/stdinhand.c freeciv/server/stdinhand.c
--- freeciv/server/stdinhand.c	2007-01-17 13:38:21.0 +0200
+++ freeciv/server/stdinhand.c	2007-01-19 04:46:51.0 +0200
@@ -682,7 +682,8 @@
 | H_REVOLUTION,
  /* novice */   H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
 | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE
-			| H_DIPLOMACY | H_REVOLUTION | H_EXPANSION,
+			| H_DIPLOMACY | H_REVOLUTION | H_EXPANSION
+| H_FIREPOWER,
  /* easy */	H_RATES | H_TARGETS | H_HUTS | H_NOPLANES 
 | H_DIPLOMAT | H_LIMITEDHUTS | H_DEFENSIVE
 | H_REVOLUTION | H_EXPANSION,
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#18232) UN nation

2007-01-18 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=18232 >

On 1/19/07, Christian Knoke <[EMAIL PROTECTED]> wrote:
>
> http://bugs.freeciv.org/Ticket/Display.html?id=18232 >
>
> Daniel Markstedt wrote on Jan 14, 19:06 (-0800):
> >
> > http://bugs.freeciv.org/Ticket/Display.html?id=18232 >
> >
> > A fictional UN nation!
> >
> > Leaders are its Secretary-Generals and cities are its various agencies.
>
> ; "Dag Hammarskjöld",   in Swedish nation
>
> I think when this is applied, Dag Hammarskjöld can be moved to the UN
> nation.
>

Already done!

> AFAICS the WWF is not an UN organisation.
>

You're correct.

> Christian
>
>

 ~Daniel



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#33445) win32 client build broken (patch attached)

2007-01-18 Thread [EMAIL PROTECTED]

http://bugs.freeciv.org/Ticket/Display.html?id=33445 >

I will test the win32 client build this weekend.

JKL

On 1/18/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
> http://bugs.freeciv.org/Ticket/Display.html?id=33445 >
>
> On 1/19/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
> >  I'll send another patch containing parts of the original patch that
> > were left out from these. They probably should go in later.
>
>  Here
>
>
>  - ML
>
>
>
>



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#34035) [Patch] Fix memory leak in terrain.ruleset loading

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=34035 >

 $subject


 - ML

diff -Nurd -X.diff_ignore freeciv/server/ruleset.c freeciv/server/ruleset.c
--- freeciv/server/ruleset.c	2006-08-18 10:51:27.0 +0300
+++ freeciv/server/ruleset.c	2007-01-19 04:23:36.0 +0200
@@ -1734,6 +1734,8 @@
 BV_SET(pterrain->native_to, class->id);
   }
 }
+free(slist);
+
 pterrain->helptext = lookup_helptext(file, tsec[i]);
   } terrain_type_iterate_end;
 
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#33876) [Patch] tile_has_base_effect()

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=33876 >

On 1/17/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
>  This adds new module base.[ch]. It contains one function,
> base_has_effect(). New function tile_has_base_effect() in tile.c uses
> it. tile_has_base_effect() is called from number of places instead of
> directly checking if tile contains fortress/airbase.

 Eventually all these effects will be base flags. Namespaces changed
accordingly.


 - ML

diff -Nurd -X.diff_ignore freeciv/common/aicore/pf_tools.c freeciv/common/aicore/pf_tools.c
--- freeciv/common/aicore/pf_tools.c	2007-01-19 03:51:15.0 +0200
+++ freeciv/common/aicore/pf_tools.c	2007-01-19 03:57:30.0 +0200
@@ -21,6 +21,7 @@
 #include "log.h"
 #include "mem.h"
 
+#include "base.h"
 #include "game.h"
 #include "movement.h"
 
@@ -571,7 +572,7 @@
 return FALSE;
   }
 
-  if (tile_has_special(ptile, S_AIRBASE)) {
+  if (tile_has_base_flag(ptile, BF_REFUEL)) {
 /* All airbases are considered non-dangerous, although non-allied ones
  * are inaccessible. */
 return FALSE;
diff -Nurd -X.diff_ignore freeciv/common/base.c freeciv/common/base.c
--- freeciv/common/base.c	1970-01-01 02:00:00.0 +0200
+++ freeciv/common/base.c	2007-01-19 03:58:42.0 +0200
@@ -0,0 +1,70 @@
+/
+ Freeciv - Copyright (C) 2004 - The Freeciv Team
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+/
+
+#ifdef HAVE_CONFIG_H
+#include 
+#endif
+
+#include 
+
+#include "base.h"
+
+/
+  Check if base provides effect
+/
+bool base_flag(Base_type_id base_type, enum base_flag_id flag)
+{
+  switch(base_type) {
+  case BASE_TYPE_1:
+/* Fortress */
+switch(flag) {
+case BF_NOT_AGGRESSIVE:
+case BF_DEFENSE_BONUS:
+case BF_WATCHTOWER:
+case BF_CLAIM_TERRITORY:
+case BF_NO_STACK_DEATH:
+case BF_DIPLOMAT_DEFENSE:
+  return TRUE;
+
+case BF_REFUEL:
+case BF_NO_HP_LOSS:
+case BF_ATTACK_UNREACHABLE:
+case BF_PARADROP_FROM:
+case BF_LAST:
+  return FALSE;
+}
+break;
+
+  case BASE_TYPE_2:
+/* Airbase */
+switch(flag) {
+case BF_NO_STACK_DEATH:
+case BF_DIPLOMAT_DEFENSE:
+case BF_REFUEL:
+case BF_NO_HP_LOSS:
+case BF_ATTACK_UNREACHABLE:
+case BF_PARADROP_FROM:
+  return TRUE;
+
+case BF_NOT_AGGRESSIVE:
+case BF_DEFENSE_BONUS:
+case BF_WATCHTOWER:
+case BF_CLAIM_TERRITORY:
+case BF_LAST:
+  return FALSE;
+}
+break;
+  }
+
+  return FALSE;
+}
diff -Nurd -X.diff_ignore freeciv/common/base.h freeciv/common/base.h
--- freeciv/common/base.h	1970-01-01 02:00:00.0 +0200
+++ freeciv/common/base.h	2007-01-19 03:56:58.0 +0200
@@ -0,0 +1,39 @@
+/** 
+ Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+***/
+#ifndef FC__BASE_H
+#define FC__BASE_H
+
+#include "fc_types.h"
+
+enum base_type_id { BASE_TYPE_1, BASE_TYPE_2 };
+
+typedef enum base_type_id Base_type_id;
+
+enum base_flag_id {
+  BF_NOT_AGGRESSIVE, /* Unit inside are not considered aggressive
+* if base is close to city */
+  BF_DEFENSE_BONUS,  /* Base provides defense bonus for units inside */
+  BF_NO_STACK_DEATH, /* Units inside will not die all at once */
+  BF_WATCHTOWER, /* Base can act as watchtower */
+  BF_CLAIM_TERRITORY,/* Base claims tile ownership */
+  BF_DIPLOMAT_DEFENSE,   /* Base provides bonus for defending diplomat */
+  BF_REFUEL, /* Base refuels units */
+  BF_NO_HP_LOSS, /* Units do not lose hitpoints when in base */
+  BF_ATTACK_UNREACHABLE, /* Unreachable units inside base can be attacked */

[Freeciv-Dev] (PR#34034) wishlist: contol AI aggressiveness

2007-01-18 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=34034 >

This is related to my ticket about AI difficulty but could be
implemented separately.

This idea would give AIs a new "aggressiveness" variable besides the
difficulty level. In forum user Sol's words, it could for example be
"...a 1-5 value box that would set how agressive the enemy AI is, with
1 being tree-hugger and 5 being Ghengis Khan..."

 ~Daniel



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#34032) wishlist: further cripple novice AI

2007-01-18 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=34032 >

Many players are still struggling to get the upper hand over even the
easiest AI, as evident in for example a very active forum thread
called: "Novice" AI can still kick my ass. To make a long story short,
players are getting slaughtered by novice AIs because it still has a
very effective playing style and most importantly, because it is
exceedingly aggressive.

I suggest we cripple "novice" further so that it becomes what players
expect it to be: something that even a novice can stand a chance
against. It should build sparser empires, expand less overseas and be
less militarily aggressive.

This is IMHO a serious problem for single player Freeciv, since
players are exceedingly frustrated because of its steep learning
curve. With online Freeciv on the decline (not least due to the
extended downtime of Pubserver) it is of outmost importance that
single player gaming is promoted.

 ~Daniel



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#33445) win32 client build broken (patch attached)

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=33445 >

On 1/19/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>  I'll send another patch containing parts of the original patch that
> were left out from these. They probably should go in later.

 Here


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/graphics.c freeciv/client/gui-win32/graphics.c
--- freeciv/client/gui-win32/graphics.c	2006-07-17 23:56:51.0 +0300
+++ freeciv/client/gui-win32/graphics.c	2007-01-19 00:56:56.0 +0200
@@ -56,8 +56,6 @@
 
 extern HINSTANCE freecivhinst;
 
-HCURSOR cursors[CURSOR_LAST * NUM_CURSOR_FRAMES];
-
 struct sprite *intro_gfx_sprite = NULL;
 struct sprite *radar_gfx_sprite = NULL;
 
@@ -86,87 +84,6 @@
   radar_gfx_sprite = load_gfxfile(tileset_mini_intro_filename(tileset));
 }
 
-/**
-  Load the cursors (mouse substitute sprites), including a goto cursor,
-  an airdrop cursor, a nuke cursor, and a patrol cursor.
-**/
-void
-load_cursors(void)
-{
-  enum cursor_type cursor;
-  ICONINFO ii;
-  int frame, i;
-
-  /* For some reason win32 lets you enter a cursor size, which
-   * only works as long as it's this size. */
-  int width = GetSystemMetrics(SM_CXCURSOR);
-  int height = GetSystemMetrics(SM_CYCURSOR);
-
-  BITMAP *xor_bmp, *and_bmp;
-
-  xor_bmp = bmp_new(width, height);
-  and_bmp = bmp_new(width, height);
-
-  ii.fIcon = FALSE;
-
-  for (cursor = 0; cursor < CURSOR_LAST; cursor++) {
-int hot_x, hot_y;
-int x, y;
-int minwidth, minheight;
-
-for (frame = 0; frame < NUM_CURSOR_FRAMES; frame++) {
-
-struct sprite *sprite = get_cursor_sprite(tileset, cursor, 
-		  &hot_x, &hot_y, frame);
-
-ii.xHotspot = MIN(hot_x, width);
-ii.yHotspot = MIN(hot_y, height);
-
-memset(xor_bmp->bmBits, 0,   width * height * 4);
-memset(and_bmp->bmBits, 255, width * height * 4);
-
-minwidth  = MIN(width,  sprite->img->bmWidth);
-minheight = MIN(height, sprite->img->bmHeight);
-
-for (y = 0; y < minheight; y++) {
-  BYTE *src = (BYTE *)sprite->img->bmBits + sprite->img->bmWidthBytes * y;
-  BYTE *xor_dst = (BYTE *)xor_bmp->bmBits + xor_bmp->bmWidthBytes * y;
-  BYTE *and_dst = (BYTE *)and_bmp->bmBits + and_bmp->bmWidthBytes * y;
-  for (x = 0; x < minwidth; x++) {
-	if (src[3] > 128) {
-	  *xor_dst++ = src[0];
-	  *xor_dst++ = src[1];
-	  *xor_dst++ = src[2];
-	  *xor_dst++ = 255;
-	  *and_dst++ = 0;
-	  *and_dst++ = 0;
-	  *and_dst++ = 0;
-	  *and_dst++ = 0;
-	} else {
-	  and_dst += 4;
-	  xor_dst += 4;
-	}
-	src += 4;
-  }
-}
-
-ii.hbmMask = BITMAP2HBITMAP(and_bmp);
-ii.hbmColor = BITMAP2HBITMAP(xor_bmp);
-
-i = cursor * NUM_CURSOR_FRAMES + frame;
-
-cursors[i] = CreateIconIndirect(&ii);
-
-DeleteObject(ii.hbmMask);
-DeleteObject(ii.hbmColor);
-
-}
-  }
-
-  bmp_free(xor_bmp);
-  bmp_free(and_bmp);
-}
-
 /
   Frees the introductory sprites.
 /
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/gui_main.c freeciv/client/gui-win32/gui_main.c
--- freeciv/client/gui-win32/gui_main.c	2006-07-17 23:56:51.0 +0300
+++ freeciv/client/gui-win32/gui_main.c	2007-01-19 00:56:56.0 +0200
@@ -56,6 +56,8 @@
 #include 
 
 #include "gui_main.h"
+#include "gui_mouse.h"
+/*anim_cursor()*/
 
 const char *client_string = "gui-win32";
 
@@ -711,8 +713,6 @@
   return TRUE;
 }
 
-extern void anim_cursor(float time);
-
 /**
 
 **/
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/gui_mouse.c freeciv/client/gui-win32/gui_mouse.c
--- freeciv/client/gui-win32/gui_mouse.c	1970-01-01 02:00:00.0 +0200
+++ freeciv/client/gui-win32/gui_mouse.c	2007-01-19 00:56:56.0 +0200
@@ -0,0 +1,144 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+/*memset()*/
+#include "windows.h"
+
+#include "shared.h"
+/*MIN*/
+
+#include "tilespec.h"
+/*enum cursor_type
+ * NUM_CURSOR_FRAMES
+ * get_cursor_sprite() */
+
+#include "graphics.h"
+/*bmp_new()
+ load_cursors() declaration (via graphics_g.h)*/
+#include "gui_mouse.h"
+/*anim_cursor() declaration*/
+#include "mapview.h"
+/*update_mouse_cursor() declaration (via mapview_g.h)*/
+#include "sprite.h"
+/*struct sprite*/
+
+/*The cursors are initialized by load_cursors*/
+static HCURSOR anim_cursors[CURSOR_LAST][NUM_CURSOR_FRAMES];
+static HCURSOR default_cursor;
+
+/*This must be updated every time the cursor type is changed*/
+static enum cursor_type current_cursor_type ;
+
+/**
+  Load the cursors (mouse substitute sprites), including 

Re: [Freeciv-Dev] (PR#33445) win32 client build broken (patch attached)

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=33445 >

> From: Jonathan Landis <[EMAIL PROTECTED]>
>
>   I wrote a patch for the Win32 client a couple of weeks ago.

 Thanks for the patch, Jonathan.

 I cannot compile and I have not even seen win32 client, but I looked
some of the most obviously correct things from your patch. Attached is
two patches which I split from your patch and reworked a bit.
 I decided that since worklist_report had player pointer only for
accessing worklists and worklists no longer are part of player
structure, whole player pointer should go.
 Could you check that I have not made any mistakes (that it compiles
for example)? I plan to commit these two soon.
 I'll send another patch containing parts of the original patch that
were left out from these. They probably should go in later.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/helpdlg.c freeciv/client/gui-win32/helpdlg.c
--- freeciv/client/gui-win32/helpdlg.c	2006-10-31 18:28:41.0 +0200
+++ freeciv/client/gui-win32/helpdlg.c	2007-01-19 00:41:57.0 +0200
@@ -655,7 +655,7 @@
   
   /* Give tile a background color, based on the type of unit
* FIXME: make a new set of colors for this.   */
-  switch (utype->move_type) {
+  switch (get_unit_move_type(utype)) {
   case LAND_MOVING: bg_color = COLOR_OVERVIEW_LAND;   break;
   case SEA_MOVING:  bg_color = COLOR_OVERVIEW_OCEAN;  break;
   case HELI_MOVING: bg_color = COLOR_OVERVIEW_MY_UNIT;break;
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/menu.c freeciv/client/gui-win32/menu.c
--- freeciv/client/gui-win32/menu.c	2006-10-31 18:28:41.0 +0200
+++ freeciv/client/gui-win32/menu.c	2007-01-19 00:34:58.0 +0200
@@ -602,7 +602,7 @@
   popup_find_dialog();
   break;
 case IDM_GOVERNMENT_WORKLISTS:
-  popup_worklists_report(game.player_ptr);
+  popup_worklists_report();
   break;
 case IDM_GOVERNMENT_REVOLUTION:
   popup_revolution_dialog(NULL);
diff -Nurd -X.diff_ignore freeciv/client/gui-win32/wldlg.c freeciv/client/gui-win32/wldlg.c
--- freeciv/client/gui-win32/wldlg.c	2006-07-17 23:56:51.0 +0300
+++ freeciv/client/gui-win32/wldlg.c	2007-01-19 00:39:09.0 +0200
@@ -37,7 +37,9 @@
 #include "log.h"
 #include "climisc.h"
 #include "clinet.h"
-
+
+#include "civclient.h"
+
 #include "wldlg.h"
 #include "citydlg.h"
 
@@ -124,11 +126,11 @@
 
   /* Fill in the global worklists now?  */
   /* perhaps judicious use of goto would be good here? -mck */
-  if (wl_first && game.player_ptr->worklists[0].is_valid && pcity) {
+  if (wl_first && client.worklists[0].is_valid && pcity) {
 int i;
 
 for (i = 0; i < MAX_NUM_WORKLISTS; i++) {
-  if (game.player_ptr->worklists[i].is_valid) {
+  if (client.worklists[i].is_valid) {
 	dest_wids[wids_used] = wid_encode(FALSE, TRUE, i);
 	wids_used++;
   }
@@ -147,11 +149,11 @@
   }
 
   /* we didn't fill in the global worklists above */
-  if (!wl_first && game.player_ptr->worklists[0].is_valid && pcity) {
+  if (!wl_first && client.worklists[0].is_valid && pcity) {
 int i;
 
 for (i = 0; i < MAX_NUM_WORKLISTS; i++) {
-  if (game.player_ptr->worklists[i].is_valid) {
+  if (client.worklists[i].is_valid) {
 dest_wids[wids_used] = wid_encode(FALSE, TRUE, i);
 wids_used++;
   }
@@ -169,7 +171,6 @@
 struct worklist_report {
   HWND win;
   HWND list;
-  struct player *pplr;
   char worklist_names[MAX_NUM_WORKLISTS][MAX_LEN_NAME];
   char *worklist_names_ptrs[MAX_NUM_WORKLISTS + 1];
   struct worklist *worklist_ptr[MAX_NUM_WORKLISTS];
@@ -235,10 +236,10 @@
   int i, n;
 
   for (i = 0, n = 0; i < MAX_NUM_WORKLISTS; i++) {
-if (preport->pplr->worklists[i].is_valid) {
-  strcpy(preport->worklist_names[n], preport->pplr->worklists[i].name);
+if (client.worklists[i].is_valid) {
+  strcpy(preport->worklist_names[n], client.worklists[i].name);
   preport->worklist_names_ptrs[n] = preport->worklist_names[n];
-  preport->worklist_ptr[n] = &preport->pplr->worklists[i];
+  preport->worklist_ptr[n] = &client.worklists[i];
 
   n++;
 }
@@ -268,18 +269,18 @@
 
   /* Look for the last free worklist */
   for (i = 0; i < MAX_NUM_WORKLISTS; i++)
-if (!preport->pplr->worklists[i].is_valid)
+if (!client.worklists[i].is_valid)
   break;
 
   for (j = sel; j < i - 1; j++) {
-copy_worklist(&preport->pplr->worklists[j],
-  &preport->pplr->worklists[j + 1]);
+copy_worklist(&client.worklists[j],
+  &client.worklists[j + 1]);
   }
 
   /* The last worklist in the set is no longer valid -- it's been slid up
* one slot. */
-  preport->pplr->worklists[i-1].is_valid = FALSE;
-  strcpy(preport->pplr->worklists[i-1].name, "\0");
+  client.worklists[i-1].is_valid = FALSE;
+  strcpy(client.worklists[i-1].name, "\0");
 
   global_list_update(preport);
 }
@@ -292,9 +293,9 @@
   struct worklist_r

Re: [Freeciv-Dev] (PR#18232) UN nation

2007-01-18 Thread Christian Knoke

http://bugs.freeciv.org/Ticket/Display.html?id=18232 >

Daniel Markstedt wrote on Jan 14, 19:06 (-0800):
> 
> http://bugs.freeciv.org/Ticket/Display.html?id=18232 >
> 
> A fictional UN nation!
> 
> Leaders are its Secretary-Generals and cities are its various agencies.

; "Dag Hammarskjöld",   in Swedish nation

I think when this is applied, Dag Hammarskjöld can be moved to the UN
nation.

AFAICS the WWF is not an UN organisation.

Christian


-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#33762) [Patch] UCF_UNREACHABLE

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=33762 >

On 1/16/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
>  Only F_FIGHER can attack air units. It has been hardcoded to
> AIR_MOVING. This patch turns it into unit class flag.

 - Better helptext for F_FIGHTER
 - Helptext for UCF_UNREACHABLE


 - ML

diff -Nurd -X.diff_ignore freeciv/client/helpdata.c freeciv/client/helpdata.c
--- freeciv/client/helpdata.c	2007-01-17 09:20:24.0 +0200
+++ freeciv/client/helpdata.c	2007-01-18 16:38:33.0 +0200
@@ -771,6 +771,10 @@
 sprintf(buf + strlen(buf),
 	_("  * Gets used up in making an attack.\n"));
   }
+  if (unit_class_flag(get_unit_class(utype), UCF_UNREACHABLE)) {
+sprintf(buf + strlen(buf),
+	_("  * Is unreachable. Most units cannot attack this one.\n"));
+  }
 
   if (utype->impr_requirement != B_LAST) {
 sprintf(buf + strlen(buf),
@@ -915,7 +919,7 @@
 sprintf(buf + strlen(buf), _("* May not be bribed.\n"));
   }
   if (unit_type_flag(utype, F_FIGHTER)) {
-sprintf(buf + strlen(buf), _("* Can attack enemy air units.\n"));
+sprintf(buf + strlen(buf), _("* Can attack otherwise unreachable enemy units.\n"));
   }
   if (unit_type_flag(utype, F_PARTIAL_INVIS)) {
 sprintf(buf + strlen(buf), _("* Is invisible except when next to an"
diff -Nurd -X.diff_ignore freeciv/common/combat.c freeciv/common/combat.c
--- freeciv/common/combat.c	2006-07-21 23:18:09.0 +0300
+++ freeciv/common/combat.c	2007-01-18 16:37:07.0 +0200
@@ -93,7 +93,8 @@
   }
 
   /* 2. Only fighters can attack planes, except in city or airbase attacks */
-  if (!unit_flag(punit, F_FIGHTER) && is_air_unit(pdefender)
+  if (!unit_flag(punit, F_FIGHTER)
+  && unit_class_flag(get_unit_class(unit_type(pdefender)), UCF_UNREACHABLE)
   && !(pcity || tile_has_special(dest_tile, S_AIRBASE))) {
 return FALSE;
   }
diff -Nurd -X.diff_ignore freeciv/common/unittype.c freeciv/common/unittype.c
--- freeciv/common/unittype.c	2006-08-18 10:52:03.0 +0300
+++ freeciv/common/unittype.c	2007-01-18 16:37:07.0 +0200
@@ -41,7 +41,7 @@
 
 static const char *unit_class_flag_names[] = {
   "TerrainSpeed", "DamageSlows", "CanOccupy", "Missile",
-  "RoadNative", "BuildAnywhere"
+  "RoadNative", "BuildAnywhere", "Unreachable"
 };
 static const char *flag_names[] = {
   "TradeRoute" ,"HelpWonder", "IgZOC", "NonMil", "IgTer", 
diff -Nurd -X.diff_ignore freeciv/common/unittype.h freeciv/common/unittype.h
--- freeciv/common/unittype.h	2006-08-18 10:52:03.0 +0300
+++ freeciv/common/unittype.h	2007-01-18 16:37:07.0 +0200
@@ -32,6 +32,7 @@
   UCF_MISSILE,
   UCF_ROAD_NATIVE,
   UCF_BUILD_ANYWHERE,
+  UCF_UNREACHABLE,
   UCF_LAST
 };
 
diff -Nurd -X.diff_ignore freeciv/data/civ1/units.ruleset freeciv/data/civ1/units.ruleset
--- freeciv/data/civ1/units.ruleset	2006-08-18 10:51:28.0 +0300
+++ freeciv/data/civ1/units.ruleset	2007-01-18 16:37:07.0 +0200
@@ -52,7 +52,7 @@
 ;
 ; name  = Name as used in other rulesets
 ; move_type = Where unit moves; Land, Sea, Both or Air. Air is special value for
-; units which can only be attacked by units with "Fighter" flag
+; airplanes
 ; min_speed = Minimum speed after damage and effects
 ; hp_loss_pct   = Hitpoints lost each turn if unit not in city or airbase
 ; flags = List of unit class flags
@@ -65,6 +65,8 @@
 ; "Missile"   = Unit is destroyed when it attacks
 ; "RoadNative"= Road tiles are always considered native terrain
 ; "BuildAnywhere" = Unit can be built even in the middle of non-native terrain
+; "Unreachable"   = Unit can be attacked only by units with "Fighter" flag or on
+;   city or airbase
 
 [unitclass_land]
 name  = _("Land")
@@ -85,14 +87,14 @@
 move_type = "Air"
 min_speed = 1
 hp_loss_pct   = 0
-flags = ""
+flags = "Unreachable"
 
 [unitclass_missile]
 name  = _("Missile")
 move_type = "Air"
 min_speed = 1
 hp_loss_pct   = 0
-flags = "Missile"
+flags = "Missile", "Unreachable"
 
 ; Below: The individual units, one per section.
 ;
diff -Nurd -X.diff_ignore freeciv/data/civ2/units.ruleset freeciv/data/civ2/units.ruleset
--- freeciv/data/civ2/units.ruleset	2006-08-18 10:51:28.0 +0300
+++ freeciv/data/civ2/units.ruleset	2007-01-18 16:37:07.0 +0200
@@ -52,7 +52,7 @@
 ;
 ; name  = Name as used in other 
 ; move_type = Where unit moves; Land, Sea, Both or Air. Air is special value for
-; units which can only be attacked by units with "Fighter" flag
+; airplanes
 ; min_speed = Minimum speed after damage and effects
 ; hp_loss_pct   = Hitpoints lost each turn if unit not in city or airbase
 ; flags = List of unit class flags
@@ -65,13 +65,15 @@
 ; "Missile"   = Unit is destroyed when it attacks
 ; "RoadNative"= Road tiles are always considered native terrain
 ; "BuildAnywhere" = Unit can be bu

[Freeciv-Dev] (PR#33528) Amplio improvements

2007-01-18 Thread Daniel Markstedt

http://bugs.freeciv.org/Ticket/Display.html?id=33528 >

Here's my selection. It consists of: fog, disorder, select, freight and
user attention. Edited and ready to commit:

http://bugs.freeciv.org/Ticket/Attachment/177255/121184/amplio_improvements_selection.tar.bz2

If there are no objections, I will commit this to trunk this weekend.
I'm also planning to backport all qualitative changes to Amplio to S2_1
soon.

 ~Daniel



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#33979) Uninitialized variable in aircraft auto-return code

2007-01-18 Thread Marko Lindqvist

http://bugs.freeciv.org/Ticket/Display.html?id=33979 >

 Variable 'alive' will be used uninitialized if no path to refuel
point is found. Will commit attached fix immediately.


 - ML

diff -Nurd -X.diff_ignore freeciv/server/unittools.c freeciv/server/unittools.c
--- freeciv/server/unittools.c	2007-01-17 17:46:22.0 +0200
+++ freeciv/server/unittools.c	2007-01-18 15:26:37.0 +0200
@@ -396,7 +396,7 @@
 if (carrier) {
   put_unit_onto_transporter(punit, carrier);
 } else {
-  bool alive;
+  bool alive = true;
 
   struct pf_map *map;
   struct pf_parameter parameter;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev