[Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13342 >
> [jdorje - Mon Jun 27 19:28:04 2005]:
>
> Argh!
>
> This crash is caused by the patch that fixes bug #13198.
>
> In last crash (442921), techpenalty is set to 0. When a unit
> investigates a hut, it doesn't (as one might expect) pick a tech and
> give it to you. Instead it picks a tech, sets your research to be on
> that tech, completes research, then restores the previous research.
> However now picking a random tech uses choose_tech() which may complete
> the tech immediately if there are enough bulbs, which may sometimes
> happen if techpenalty is less than 100. Thus the tech completes, and if
> there's no goal then the research target is set back to A_UNSET which is
> what is passed in to found_new_tech.
This can happen even if techpenalty=100.
For example if player.research.got_tech=TRUE or
player.research.researching=A_UNSET, the bulbs aren't lost
and choose_random_tech() leaves player.research.researching=A_UNSET
> For S2_0 the solution is to revert the 13198 patch. Maybe one of the
> other patches to fix this bug can be used and will be less invasive.
>
> For the development branch the fix is harder, since we probably want to
> fix 13198 as well. I suggest changing pick_random_tech so that it
> doesn't have any side effects just returns the tech. Then the caller
> will have to call found_new_tech or choose_tech as needed to make use of
> the random tech that is returned.
>
> -jason
--
mateusz
- [Freeciv-Dev] Re: (PR#13342) pubserver 2.0 crash in found_new_tech, Benoit Hudson, 2005/06/27
- [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech, Jason Short, 2005/06/27
- [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech, Jason Short, 2005/06/27
- [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech, Jason Short, 2005/06/27
- [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech,
Mateusz Stefek <=
- [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech, Mateusz Stefek, 2005/06/27
- [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech, Mateusz Stefek, 2005/06/27
- [Freeciv-Dev] Re: (PR#13342) pubserver 2.0 crash in found_new_tech, Jason Short, 2005/06/27
|
|