Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [Patch] Cleanup of attack power calculations
Home

[Freeciv-Dev] Re: [Patch] Cleanup of attack power calculations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Cleanup of attack power calculations
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Feb 2002 20:24:48 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Feb 26, 2002 at 05:59:45PM +0000, Gregory Berkolaiko wrote:
> On Tue, 26 Feb 2002, Raimar Falke wrote:
> > > > 
> > > > > > +      a = base_unit_belligerence_primitive(i, FALSE, SINGLE_MOVE,
> > > > > > +                                      unit_types[i].hp);
> > > > > 
> > > > > why don't you feed 
> > > > > (m == LAND_MOVING || player_knows_improvement_tech(pplayer, B_PORT)
> > > > > as a parameter to base_unit_belligerence_primitive??
> > > > 
> > > > It looks like do_make_unit_veteran is the right thing.
> > > 
> > > no it isn't
> > 
> > Indead. 
> > 
> > But this is the only case where this factor would be needed.
> 
> what I meant is make new variable
> bool will_be_veteran = (m == LAND_MOVING 
>                         || player_knows_improvement_tech(pplayer, B_PORT))
> and then call
> a = base_unit_belligerence_primitive(i, will_be_veteran, 
>                                      SINGLE_MOVE, unit_types[i].hp);
> 
> instead of
> 
> a = base_unit_belligerence_primitive(i, FALSE,
>                                      SINGLE_MOVE, unit_types[i].hp);

Ok.

> [...]
> 
> > > If you are not prepared to do it properly, then commit the patch, it's an
> > > improvement anyway.  Others will finish what you left hanging.
> > 
> > Ok.
> 
> Please add a FIXME then.
> It is an error and it should be fixed.
> 
> > > P.S. I remember you saying, I quote, "strong indication for me to fix the
> > > things if you notice them (even if there aren't part of the original 
> > > authors
> > > intentions)".  It seems you forget what you say...  
> > 
> > I had this in mind as I said: write down the problems which were
> > identified in the todo list.
> 
> Good.  So FIXME you would do then.

To be honest I think that even in this small patch you could add a lot
of FIXMEs (function naming, variable naming, use of float to discard
the scaling constants, comments, ...). So for FIXMEs which can be
solved easily just solve them.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
    1) Customers cause problems.
    2) Marketing is trying to create more customers.
  Therefore:
    3) Marketing is evil.


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