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: annoying new bug in movement


Hi Jim, Lincoln, others,

On Thu, 4 Dec 2003, Jim Kingdon wrote:

> wanted to go.  This is fairly new, probably with the new path code.

Yes.
Two things:
(1) check_move_action does not check for all the same things as 
do_move_action expects.
(2) do_move_action underwent a significant revision with a patch 
Peter provided on Nov 18. I checked in the patch more recently  
(Nov 29). In particular, the trouble seems to come from this part:

-    } else if (dist == 1
-              || (dist == 2 && border_slide_possible(u2, ox, oy, 
x, y))) {

+    } else if((dir = choose_move_direction(unit2, x, y, 0, 
CMD_NONE)) >= 0) {

This changed what sort of things fell through to the "else" 
branch. Of course, there was no "else" branch; flow simply 
returned to the trunk of the function, which had:

     if (alive(unit)) {
         acpcost = max(acpcost, u_acp_to_move(u2));
         if (acpcost < 1)
           acpcost = 1;
         use_up_acp(unit, acpcost);
     }

so that ACP was being deducted whether or not the unit was 
actually being moved.

> By "fails" I mean that the ACP now shows "0/1" but the infantry hasn't
> gone anywhere.  It doesn't even go into reserve mode, which I could
> recover from.

I have put in an "else" branch to catch anything that falls 
through. It does not correctly address all the possibilities; 
choose_move_direction() and the stuff inside its branch must 
likely be improved to address them properly.

But at least now a notification is provided to let the player know 
that the movement cannot be performed, and ACP is prevented from 
being deducted in such a circumstance.

Maybe you could give things a try now.

  Thanks,
    Eric



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