Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2002:
[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g
Home

[Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/g

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/39967
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 1 Sep 2002 00:19:20 +0000 (GMT)

On Sat, 31 Aug 2002 freeciv@xxxxxxxxxxxxxxxxxxxxx wrote:
> #0unit_type (punit=0x0) at unittype.c:94
> 94    return get_unit_type(punit->type);
> (gdb) #0unit_type (punit=0x0) at unittype.c:94
> #10x0805c659 in search_best_target (pplayer=0x8130ae0, pcity=0x834ac38,
>   punit=0x82d4500) at autoattack.c:98

Let's see. We found a tile which
        - has units
        - is_enemy_unit_tile(map_get_tile(x, y), pplayer) == TRUE
        - but where get_defender(punit, x, y) == NULL

We don't check for NULL return value from get_defender, so we core.
Obviously we should check this, problem solved and patch attached. But why
does it happen?

Only case I can think of is a transport of one of your allies carrying a
unit whose owner you are at war with getting within range of the
autoattack.

That should have triggered the following LOG_ERROR:

    freelog(LOG_ERROR, "Get_def bugged at (%d,%d). The most likely course"
            " is a unit on an ocean square without a transport. The owner"
            " of the unit is %s", x, y, unit_owner(debug_unit)->name);

Is there any way to get LOG_ERROR and LOG_FATAL output from a game put
into the core bug report?

Yours
Per

"I don't see why people are so upset about cloning sheep. American
television networks have been doing that to their audiences for years."
-- Jello Biafra

Attachment: autoattackbugfix1.diff
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: core file on civserver, http://civserver.freeciv.org/games/39967, Per I. Mathisen <=