[Freeciv-Dev] (PR#34379) [Patch] pft_fill_unit_default_parameters() and UCF_TERRAIN_SPEED

2007-01-23 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34379 

 This fixes pft_fill_unit_default_parameters() in respect of UCF_TERRAIN_SPEED.


 - 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-22 17:18:36.0 +0200
+++ freeciv/common/aicore/pf_tools.c	2007-01-23 17:39:15.0 +0200
@@ -818,19 +818,35 @@
 	struct unit *punit)
 {
   parameter-turn_mode = TM_CAPPED;
-  if (is_air_unit(punit) || is_heli_unit(punit)) {
-parameter-unknown_MC = SINGLE_MOVE;
-  } else if (is_sailing_unit(punit)) {
-parameter-unknown_MC = 2 * SINGLE_MOVE;
-  } else {
-assert(is_ground_unit(punit));
-parameter-unknown_MC = SINGLE_MOVE;
+
+  parameter-unknown_MC = SINGLE_MOVE;
+  if (unit_class_flag(get_unit_class(unit_type(punit)), UCF_TERRAIN_SPEED)) {
+/* Unit is subject to terrain movement costs */
+struct unit_type *punittype = unit_type(punit);
+bv_special specials;
+BV_CLR_ALL(specials); /* This works at the moment, since road is
+   * only special that affects is_native_terrain()
+   * Even if tile contains road, we can safely
+   * ignore it since movement cost for it is
+   * certainly less than SINGLE_MOVE. */
+
 terrain_type_iterate(pterrain) {
-  int mr = 2 * pterrain-movement_cost;
+  if (is_native_terrain(punittype, pterrain, specials)) {
+/* Exact movement cost of the terrain types we are unable to
+ * enter does not matter. */
+int mr = 2 * pterrain-movement_cost;
 
-  parameter-unknown_MC = MAX(mr, parameter-unknown_MC);
+parameter-unknown_MC = MAX(mr, parameter-unknown_MC);
+  } else {
+/* FIXME: We might be unable to enter unable tile at all.
+  This should have some cost too? */
+  }
 } terrain_type_iterate_end;
   }
+  if (is_sailing_unit(punit)) {
+parameter-unknown_MC *= 2;
+  }
+
   parameter-get_TB = NULL;
   parameter-get_EC = NULL;
   parameter-is_pos_dangerous = NULL;
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#34276) clients default to the wrong port

2007-01-23 Thread Kevin Benton

URL: http://bugs.freeciv.org/Ticket/Display.html?id=34276 

 [dmarks - Mon Jan 22 01:37:38 2007]:
 
 On 1/22/07, Marko Lindqvist [EMAIL PROTECTED] wrote:
 
  URL: http://bugs.freeciv.org/Ticket/Display.html?id=34276 
 
  On 1/22/07, Daniel Markstedt [EMAIL PROTECTED] wrote:
  
   The default port has changed from  to 5556, but the clients
   (tested with GTK2 and SDL) still default to .
 
   You probably have old port number stored in ~/.civclientrc
 
 Then I suppose this is bound to happen for everyone who updates.
 Suggest making a FAQ entry on it!

Rather than making a FAQ entry on it and calling it quits, why not offer
to update the .civclientrc for the user during the upgrade?  That would
take care of the largest part of the users who never really cared what
port number FC uses.


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