[Freeciv-Dev] Re: (PR#10983) Win32 server crash
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10983 >
Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10983 >
>
> I can't reproduce this on my (debian/gnu/linux) system.
OK, I take it back. I can reproduce it, but only in S2_0 (not the dev
branch which has different autoattack code).
Looks like there is a bug with autoattack that can cause a crash if a
city has more than one autoattack unit. The crash here is caused by
Eldanonde. To proceed with your savegame disable these autoattackers
(and be careful with autoattack in the future).
-----
unit_list_iterate(pcity->tile->units, punit) {
if (punit->ai.control
&& punit->activity == ACTIVITY_IDLE
&& is_military_unit(punit)) {
auto_attack_with_unit(pplayer, pcity, punit);
}
}
unit_list_iterate_end;
I would guess one unit is attacking and dying, causing the
unit_list_iterate to fail as it loops over the next unit.
unit_list_iterate_safe should be used instead. In fact all
unit_list_iterate calls should be changed to unit_list_iterate_safe.
Before 2.0.
jason
|
|