<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40619 >

> [guest - Mon Mar 23 21:39:02 2009]:
> 
> > [book - Mi 11. Feb 2009, 22:41:35]:
> > > I tried to implement this:
> > > 
> > > - calculate upkeep for all units at the beginning of the turn
> > > - save the upkeep values in the unit struct
> > > - use the saved value
> > > 
> > > At the moment the patch does not compile. I don't find the reason 
> for
> > > the following error:
> > > 
> > > [ ... ]
> > > In file included from ../unitlist.h:18,
> > >                  from ../city.h:19,
> > >                  from aisupport.c:18:
> > > ../unit.h:146: error: ‘num_output_types’ undeclared here (not in a
> > > function)
> > 
> > Try O_LAST instead of O_COUNT.
> 
> I changed that. Furthermore, there was an closing tag missing 
> (output_type_iterate_end). I corrected that and now I can compile the 
> patch. I did not had the time to try a game ...
> 
> unit_upkeep.patch.diff
> 
> * save the unit upkeep within the unit struct
> * define a function there it is calculated each turn, so that it can 
> be adapted depending on the government / research
> * based on the gold upkeep patch

I committed gold_upkeep_v4.patch; is unit_upkeep.patch.diff
intended to be applied on top of it as part of this ticket?
Or perhaps it is already included in #40759-64?


Anyway looking over the changes in it, I see that some
things could be further optimized:

- Since the upkeep value is removed from struct unitgold,
  the entire unitgold vector can be simplified to an array
  (c99 dynamic array if possible) of unit pointers.
- Perhaps the values of the unit upkeep field should be
  sent in unit info packets so that they do not have to
  be recomputed at the client side.

That's just what strikes me briefly glancing at the code.
I'll give it a more thorough check later.


-----------------------------------------------------------------------
この地図は、地球上にある場所でさえ表すか。


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to