Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7324) orders and AI goto conflict
Home

[Freeciv-Dev] (PR#7324) orders and AI goto conflict

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7324) orders and AI goto conflict
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Jan 2004 11:42:43 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7324 >

If you use orders and AI goto at the same time, you have problems.

Of course this is only a problem when a user is controlling an AI player.

For instance, download the PR#7235 savegame, connect and /take 1.  Make
sure "manual turn done in AI mode" is enabled in the client.  Start the
game, select the settlers, and initiate a client-side goto with them. 
If you do it right you should get a segfault:

civserver: aitools.c:443: ai_unit_new_role: Assertion
`(punit)->goto_dest.y != -1' failed.


Loaded symbols for /lib/libnss_files.so.2
#0  0x400ab571 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x400ab571 in kill () from /lib/libc.so.6
#1  0x400ab315 in raise () from /lib/libc.so.6
#2  0x400ac838 in abort () from /lib/libc.so.6
#3  0x400a4a4f in __assert_fail () from /lib/libc.so.6
#4  0x0810323b in ai_unit_new_role (punit=0x84925d0,
task=AIUNIT_AUTO_SETTLER,
    x=-1, y=-1) at aitools.c:468
#5  0x0809ea9f in evaluate_city_building (punit=0x84925d0, gx=0xbffff7e4,
    gy=0xbffff7e8, ferryboat=0xbffff7ec) at settlers.c:924
#6  0x0809fc9b in auto_settler_findwork (pplayer=0x8237f88, punit=0x84925d0)
    at settlers.c:1212
#7  0x080a01b7 in auto_settlers_player (pplayer=0x8237f88) at
settlers.c:1328
#8  0x080a08d6 in auto_settlers () at settlers.c:1473
#9  0x080502ae in main_loop () at srv_main.c:1389
#10 0x08050bc6 in srv_loop () at srv_main.c:1701
#11 0x080505ec in srv_main () at srv_main.c:1478
#12 0x0804a4f7 in main (argc=135546080, argv=0xbffff934) at civserver.c:157

Looks like this occurrs because the orders route isn't cleared before
the AI takes back over the unit.  This bug could be handled in two ways:

- Simply call free_unit_orders before taking over.
- Don't let human players give orders for AI units.

(Reported by Vasco on #freeciv.)

jason



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