Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] Re: (PR#10437) Another assert failure for "punit->transpor
Home

[Freeciv-Dev] Re: (PR#10437) Another assert failure for "punit->transpor

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: edearl@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10437) Another assert failure for "punit->transported_by > 0"
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Sat, 20 Nov 2004 13:01:58 -0800
Reply-to: rt@xxxxxxxxxxx

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

Marko Lindqvist wrote:
> Jason Short wrote:
> 
>>I don't understand.  punit is the cargo, right?  But pplayer is the
>>cargo's owner.  So how could these ever be different?
> 
>   I hope that gdb answers this question in a couple of hours. Obviously 
> AI (pplayer) is trying to control other players unit (cargo).


  Problem seems to originate from ai_manage_unit(pplayer, boss) call in 
ai_manage_ferryboat(), where 'boss' is not our unit. Once pplayer's 
ferry passes control to 'boss', it tries to load itself to another ferry 
(boss->owner == ferry->owner)

  But then I'm a bit loss with no proper knowledge about ai(ferry) code. 
Attached (totally untested patch) is my best shot, but I'm not at all 
surprised if it breaks more than fixes.


  - Caz

diff -Nurd -X.diff_ignore freeciv/ai/aiferry.c freeciv/ai/aiferry.c
--- freeciv/ai/aiferry.c        2004-11-20 22:23:41.343750000 +0200
+++ freeciv/ai/aiferry.c        2004-11-20 22:49:08.656250000 +0200
@@ -796,7 +796,7 @@
 
       UNIT_LOG(LOGLEVEL_FERRY, punit, "passing control to %s[%d]",
                unit_type(boss)->name, boss->id);
-      ai_manage_unit(pplayer, boss);
+      ai_manage_unit(get_player(boss->owner), boss);
     
       if (!find_unit_by_id(id) || punit->moves_left <= 0) {
         return;

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