Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] Re: (PR#12548) Save AI unit info
Home

[Freeciv-Dev] Re: (PR#12548) Save AI unit info

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#12548) Save AI unit info
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 19 Mar 2005 15:36:04 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Sat, 19 Mar 2005, Per I. Mathisen wrote:
> This patch saves passenger and bodyguard AI info to the savegame. This
> should fix a bug that makes AI ferries go pick up new passengers instead
> of completing their journeys when loading a game, resulting in the ferries
> dumping their current cargo at a pretty random location.

An alternative is to change ai/aiferry.c like this:

@@ -764,8 +783,10 @@
       /* Try to select passanger-in-charge from among our passengers */
       unit_list_iterate(ptile->units, aunit) {
         if (unit_owner(aunit) != pplayer
-            || (aunit->ai.ferryboat != punit->id
-                && aunit->ai.ferryboat != FERRY_WANTED)) {
+            || aunit->transported_by != punit->id) {
+          /* We used to check if ferryboat was set to us or to
+           * FERRY_WANTED too, but this was a bit strict. Especially
+           * when we don't save these values in a savegame. */
           continue;
         }

I am not sure which approach is better. The above is more bug-resistant I
think.

   - Per





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