Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2650) Overflow in military_amortize
Home

[Freeciv-Dev] Re: (PR#2650) Overflow in military_amortize

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#2650) Overflow in military_amortize
From: "Gregory Berkolaiko via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 27 Dec 2002 04:48:28 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Quoting "Per I. Mathisen via RT" <rt@xxxxxxxxxxxxxx>:

> 
> On Thu, 26 Dec 2002, Gregory Berkolaiko via RT wrote:
> >
> > but it also tells the city with two shield surplus to give up hope
> building
> > units although it couldbe useful too.
> 
> MAX(pcity->shield_surplus, average_production), then?
> 
> > > See the attached patch which implements this.
> >
> > Not attached :(
> 
> Just as well. It had a grevious bug. Now a new one is attached using the
> MAX above.

+  int build_time = MAX((pcity ? pcity->shield_surplus : 1),
+                       ai->stats.average_production) / build_cost;

Err...  shall I send it to your maths tutor?   He might want to adjust your exam
marks ;)


> > But,seriously, I can't really think of a way to test it other than
> visually.
> > Maybe only how longer/shorter it takes the dominant civ to take over the
> world?
> 
> You could compare the output from old military_amortize() with the new
> one and see which is best for various cases? Or we could commit&forget and
> deal with any problems afterwards. Up to you.

I can probably have fstk or paw print some debug info.

> > But I think your way of doing now it is the most scientific-like, so we
> > can remove the comment.
> 
> Scientific... mmmm, I like that ;)

Well... modulo stupid mistakes :)

G.

P.S. find_city_by_id might return NULL, you know



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