Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech
Home

[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]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13342) pubserver 2.0 crash in found_new_tech
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 27 Jun 2005 13:01:51 -0700
Reply-to: bugs@xxxxxxxxxxx

<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




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