This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fix SupplyLow flag on give/take


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]