[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]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10437 >
Marko Lindqvist wrote:
> Sorry, it seems that I sent wrong 'version' (one which asserted for
> some earlier freeciv version). Attached one should assert using CVS Nov
> 14 13:38 EET from stable branch + loading.diff. Year is 1776.
Reproducible from autogame with freeciv versions (stable branch)
Nov-18 (after loading.diff went in) but not with beta4.
> Jason Short wrote:
> > 1. punit->owner == ferryboat->owner == 4. However pplayer->player_no
> > == 3. So somehow we are trying to control a unit that we don't own.
Attached patch (on top of original loading.diff) implements band aid
you probably meant loading.diff to do. In fact we could probably remove,
in dev branch at least, that extra can_unit_load() check as its failure
never seems to be cause to assert() failure. Or maybe we just should
change assert into error message.
- Caz
diff -Nurd -X.diff_ignore freeciv/ai/aiferry.c freeciv/ai/aiferry.c
--- freeciv/ai/aiferry.c 2004-11-20 14:32:28.906250000 +0200
+++ freeciv/ai/aiferry.c 2004-11-20 14:33:39.531250000 +0200
@@ -457,7 +457,8 @@
(void) ai_unit_move(punit, ferryboat->tile);
}
- if (!can_unit_load(punit, ferryboat)) {
+ if ( punit->owner != pplayer->player_no
+ || !can_unit_load(punit, ferryboat)) {
/* Something prevented us from boarding */
/* FIXME: this is probably a serious bug, but we just skip past
* it and continue. */
|
|