What version did this bug manifest? More importantly, does it still
manifest itself with the latest SVN? I have recently committed some
changes to move_unit_partial that should prevent certain problems
caused by ambushing units. The change does not warn the AI that it
needs to recalculate what moves it should make, but it does properly
prevent the AI from making an illegal move even when it doesn't
realize that it is illegal. I will try later today to see if I can
get your save file to cause problems with the current version.
enjoy,
D. Fool
On 2/23/07, Hansenet Mail <[EMAIL PROTECTED]> wrote:
Hi John,
this should be causing the error.
Greetings,
Yogi
Does anyone have a save game where this happens? I have started to look at
solutions, but I am having some difficulty getting the AI to move the units
in the right order to replicate this so that I can ensure that I have
actually solved it.
On 2/13/07, Patrick Parker <[EMAIL PROTECTED]> wrote:
> >Note I'm also not familiar with this part of the code. I had a quick
> >look and more places test the whether the returned location is equal
> >to the requested location.
>
> Don't forget, WML can also teleport the unit during the moveto event.
>
> > > 1.
> > > We could add another bool parameter to these methods. I don't like
> > > that
> >much
> > > because we then have two return values, a "real" one and an output
> > > parameter. Not really intuitive.
> >
> >This could be made a pointer with a default of 0 so the parameter is
> >optional. I don't think this is too ugly.
>
> That works
>
> > > 2.
> > > We could add the ambush information to the return value by making
> > > a structure or something out of it, that contains the location and
> > > the
> >bool.
> > > Doesn't look very elegant to me either.
> >
> >Looks ugly to me.
>
> Ugly? I think this is probably the cleanest and best solution
> (probably because I prefer return values instead of in/out
> parameters). I believe if you define the struct with a constructor
> based on location, you could just return location and the struct would
> be implicitly constructed. However, if you don't want to define a new
> struct you could return an std::pair<location,bool>.
>
> > > 3.
> > > We could use a global variable for this. Urgh. Don't like that.
> >
> >Globals are the root of all evil
>
> Right, that would be just asking for trouble.
>
> --
> Patrick a.k.a. Sapient
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
> _______________________________________________
> Wesnoth-dev mailing list
> [email protected]
> https://mail.gna.org/listinfo/wesnoth-dev
>
--
-------------------------------------------------------------------
"In theory, theory and practice are the same,
but in practice they're different."
-------------------------------------------------------------------
John W. C. McNabb
-------------------------------------------------------------------
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev
--
-------------------------------------------------------------------
"In theory, theory and practice are the same,
but in practice they're different."
-------------------------------------------------------------------
John W. C. McNabb
-------------------------------------------------------------------
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev