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]
Other format: [Raw text]

Re: bug: unit->busy flag doesn't get cleared


>Does a unit have to be the current unit to get a command?  I think
>not.  I suspect that a bomber clicked on the incomplete infantry unit.
>Here is code from ui.c (which causes plenty of strange consequences,
>but it also can be useful, anyway here it is):

Yes. This is a likely source of the error. Particularly if, as you say,
bombers were around. Anyway, the new test for unit->acp that I put in the
net_prep_actions would still take care of the problem. So the bug should be
history now. An alternative solution would have been to test for
is_active(other) in advance_into_cell and everywhere else where a net_prep
function is called. But this would have meant a lot more work.

>> Checking out could_be_next_unit, I see that it tests only for
>> alive(unit) which is true as soon as the unit has been created. It
>> does not test for is_active(unit)
>
>Although I have no objection to this change, or testing ->busy here, I
>don't think it has any relevance to this example.  I believe that
>waitingfortasks would not be set on the incomplete unit.

True. But testing for completeness is still the correct thing to do. It may
prevent problems that we haven't even thought about yet.

>> On a sidenote, I find this repeated transfer of fuel and ammo to the
>> incomplete unit highly suspicious. Is the transfer code really
>> supposed to work with incomplete recepients, or is this another bug?
>
>The transfer code is supposed to work with incomplete recipients
>(although they aren't treated the same as completed recipients).  See
>the comment "/* Incomplete units don't need supply, but they are a
>handy overflow repository. */" in try_transfer_aux.

Well, this may have been Stan's intention, but I still feel uneasy about
it. Filling up a half-completed ship with fuel just doesn't make sense. If
overflow is a problem, it makes more sense to increase the capacity of
cities.

Hans

Hans Ronne

hronne@pp.sbbs.se



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