[Freeciv-Dev] Re: (PR#8955) aitools.c:821: ai_unit_move
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=8955 >
On Fri, 11 Jun 2004, Christian Knoke wrote:
> > Looks like a pf error to me. The path given to ai_unit_execute_path
> > contains the same coordinates as the unit's location. The attached patch
> > moves the assert higher up in the blame hierarchy.
>
> So, is my savegame buggy and I can't continue? With your patch, I get
>
> civserver: aitools.c:112: ai_unit_execute_path: Zusicherung
> »!same_pos(punit->x, punit->y, x, y)« nicht erfüllt.
No, your savegame is fine, the code is buggy. If you want to continue
playing, use this patch instead:
Index: ai/aitools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitools.c,v
retrieving revision 1.108
diff -u -r1.108 aitools.c
--- ai/aitools.c 4 Jun 2004 15:25:13 -0000 1.108
+++ ai/aitools.c 11 Jun 2004 13:52:59 -0000
@@ -113,6 +113,10 @@
* of the way so that we abort if unexpected opposition
* shows up. Any enemy on the target tile is expected to
* be our target and any attack there intentional. */
+ if (!is_tiles_adjacent(punit->x, punit->y, x, y)) {
+ UNIT_LOG(LOG_ERROR, punit, "pos %d in path is same as current pos", i);
+ return FALSE;
+ }
if (i == path->length - 1) {
(void) ai_unit_attack(punit, x, y);
} else {
- Per
|
|