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


> I take it that the newly created infantry unit is the one that got stalled
> (hard to tell from the buggy debugging code).

Yes.  My GDB work confirms that.

> This means that the unit was not complete yet when you gave it a
> command. This should not be. An incomplete unit should never be able
> to become the current unit.

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):

	} else if (can_occupy(other, unit)) {
	      if (u_acp(other->type) > 0) {
				     /* Have other unit do an enter
	      action, then
			   move. */
					/* (not quite right, move
	      should happen after
			       other unit is actually inside, in case
	      it
			   fills dest) */
				       net_prep_enter_action(other,
	      other, unit);
			net_set_move_to_task(unit, x, y, 0);

> 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.

> 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.


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