This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: fix SupplyLow flag on give/take
- To: Jim Kingdon <kingdon at panix dot com>
- Subject: Re: fix SupplyLow flag on give/take
- From: Stan Shebs <shebs at shebs dot cnchost dot com>
- Date: Thu, 19 Oct 2000 08:18:09 -0700
- CC: xconq7 at sources dot redhat dot com
- References: <200010190533.BAA19986@panix6.panix.com>
- Reply-To: shebs at shebs dot cnchost dot com
Jim Kingdon wrote:
>
> This patch makes "g" and "t" (give and take) commands update the
> SupplyLow flag. Because of the way past_halfway_point is coded, the
> results might be slightly odd (e.g. you are a fighter with fuel 2/18
> and you type "1 t" and your SupplyLow flag goes away despite the fact
> that you only have 3/18). But that seems to be a feature, not a bug,
> in past_halfway_point.
I'm looking at all the cases, and it makes my brain hurt...
Your patch is correct and worth installing (thanks!). If the fighter
is still below half, then SupplyLow will come on the moment it leaves
the transport, which might surprise a player, but the point is to
warn players, so the net effect is right.
There should probably be versions of past_halfway_point that don't
test for being in a transport, but that's where the cases start to
multiply! (owww... :-) )
It occurs to me that an alternate approach might be to record the
fuel levels when the unit last got some, and use that to detect
the real halfway point. Or, computation being cheaper than it used
to be, calculate the distance to the closest refueling point after
every move, wake up the unit when its fuel is only just sufficient
to cover that distance.
Stan