Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] (PR#12046) apply_result_on_server: Assertion `0' failed.
Home

[Freeciv-Dev] (PR#12046) apply_result_on_server: Assertion `0' failed.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#12046) apply_result_on_server: Assertion `0' failed.
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 30 Jan 2005 09:48:33 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Looks like a real bug.  We try to apply the result even if it isn't valid.

Patch is for 2.0, it probably applies to the dev branch also.

-jason

? patch.diff
? win32.diff
Index: client/agents/cma_core.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/cma_core.c,v
retrieving revision 1.64.2.2
diff -u -r1.64.2.2 cma_core.c
--- client/agents/cma_core.c    15 Dec 2004 00:15:43 -0000      1.64.2.2
+++ client/agents/cma_core.c    30 Jan 2005 17:46:22 -0000
@@ -198,6 +198,7 @@
   struct cm_result current_state;
   bool success;
 
+  assert(result->found_a_valid);
   get_current_as_result(pcity, &current_state);
 
   if (results_are_equal(pcity, result, &current_state)
@@ -502,7 +503,10 @@
                     const struct cm_result *const result)
 {
   assert(!cma_is_city_under_agent(pcity, NULL));
-  return apply_result_on_server(pcity, result);
+  if (result->found_a_valid) {
+    return apply_result_on_server(pcity, result);
+  } else
+    return TRUE; /* ???????? */
 }
 
 /****************************************************************************

[Prev in Thread] Current Thread [Next in Thread]