[Freeciv-Dev] Re: civserver segfault with new research system (PR#1221)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, Jan 11, 2002 at 03:00:54PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx
> wrote:
> >
> > > civserver: tech.c:349: base_total_bulbs_required: Assertion
> > `!is_barbarian(pplayer)' failed.
> > Aborted (core dumped)
> I'm not sure about the correct way to solve this. "How much" tech do
> barbarians need?
Do barbarians research at all?
Why did you put the assert in the first place?
> A robust solution IMHO is:
>
> + if(!is_barbarian(pplayer)) {
> if (game.rgame.tech_leakage == 0) {
> ...
> exit(1);
> }
> + }
Sounds fine. However since the bracketed statement is rather long, I
would prefer another exit point:
if (is_barabrian(pplayer)) {
return cost;
}
BTW, I know it's too late now, but I remember suggesting it before and
the suggestion was obviously ignored. It would look so much better IMHO
if the "if - else if - else if"s in base_total_bulbs_required were
converted into a switch statement.
Best,
G.
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
|
|