[Freeciv-Dev] Re: (PR#12677) CVS: Spies get built foul, so cannot make e
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12677 >
Brendon wrote:
> Should they be made foul in diplomats.c - diplomat_escape now ? Makes
> more sense than keeping it in generic unit functions.
>
> Only tested it by commenting out that line in unittools.c, just updated
> my CVS and now it won't compile (plrhand.c:1462: error: structure has no
> member named `science_cost').
Good report. The problem is setting 'foul' in create_unit_full is quite
a hack. It assumes any newly-created unit will have -1 (default = full)
movement while a recreated unit will have the same MP as the unit it is
being copied from. The problem with this is that after the
alternating-movement patch newly-created units always have 0 MP so it is
impossible to distinguish based on this.
Simply removing the line will improve behavior but not fix it.
Sometimes create_unit is called to create a unit that isn't newly built.
This happens when transferring units (generally through bribery).
It's ugly but doing it any other way is hard.
So, I see two possible fixes:
* Add a new parameter to create_unit_full, specifying whether the unit
is "foul". Probably create_unit() can default to FALSE here.
* Change -1 MP in create_unit_full to mean 0 MP. This would require
great care not to break other things, and would leave the ugliness of
punit->foul in create_unit.
-jason
- [Freeciv-Dev] Re: (PR#12677) CVS: Spies get built foul, so cannot make embassy,
Jason Short <=
|
|