Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12769) CMA should use cm_init_parameter
Home

[Freeciv-Dev] (PR#12769) CMA should use cm_init_parameter

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12769) CMA should use cm_init_parameter
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Apr 2005 12:37:00 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12769 >

As pointed out in PR#11509, the CMA should use cm_init_parameter rather 
than initializing unused fields itself.  This patch does that.

-jason

Index: client/agents/cma_core.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/cma_core.c,v
retrieving revision 1.74
diff -u -r1.74 cma_core.c
--- client/agents/cma_core.c    21 Mar 2005 17:34:27 -0000      1.74
+++ client/agents/cma_core.c    11 Apr 2005 19:36:06 -0000
@@ -582,6 +582,10 @@
   dio_get_uint8(&din, &version);
   assert(version == 2);
 
+  /* Initialize the parameter (includes some AI-only fields that aren't
+   * touched below). */
+  cm_init_parameter(parameter);
+
   output_type_iterate(i) {
     dio_get_sint16(&din, &parameter->minimal_surplus[i]);
     dio_get_sint16(&din, &parameter->factor[i]);
@@ -590,9 +594,6 @@
   dio_get_sint16(&din, &parameter->happy_factor);
   dio_get_uint8(&din, &dummy); /* Dummy value; used to be factor_target. */
   dio_get_bool8(&din, &parameter->require_happy);
-  /* These options are only for server-AI use. */
-  parameter->allow_disorder = FALSE;
-  parameter->allow_specialists = TRUE;
 
   return TRUE;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12769) CMA should use cm_init_parameter, Jason Short <=