Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2002:
[Freeciv-Dev] Re: Patch for units recovering hit points
Home

[Freeciv-Dev] Re: Patch for units recovering hit points

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Baumans <baumans@xxxxxxxxxxxxx>
Cc: Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Patch for units recovering hit points
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Thu, 25 Jul 2002 23:35:58 +0200

On Thu, Jul 25, 2002 at 05:09:03PM -0400, Baumans wrote:
>     This a pretty good idea.  The patch itself is pretty odd; to me, at
> least, it seems like it takes out and puts back in identical lines. I've
> attached a version of the patch that doesn't have that problem.  I've also
> renamed AI_RECOVER_HIT_POINTS to AIUNIT_RECOVER_HIT_POINTS for uniformity,
> removed ct and flag from your new function (ct is useless unless there is an
> infinite number of huts next to each other, flag just isn't very useful),
> and made it so that if a unit's role had been AIUNIT_RECOVER_HIT_POINTS and
> it wasn't fully healed, the role stayed the same, which removed the problem
> with going to a city without barracks and not healing all the way(I think,
> I'm not sure).
> 
>     An idea: if a unit wants to heal, but it can't find a city that's close
> enough, fotify it.  Also, if a unit's in a city, it only goes after huts.
> You might want to change that to also attack enemies that it really wants to
> fight (> 70000?).

Quick look reveals that

+  if (punit->hp < punittype->hp * 0.25 ||
+       (punit->ai.ai_role = AIUNIT_RECOVER_HIT_POINTS &&
                           ^=
+       punit->hp < punittype->hp)) {

a = is missing.

And the patch doesn't follow the style guide.

Sorry no feedback on the real content.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Only one human captain has ever survived battle with the Minbari
  fleet. He is behind me. You are in front of me. If you value your 
  lives, be somewhere else."
    -- Ambassador Delenn, "Severed Dreams," Babylon 5


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