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: code in adjust_tooling_crossover?


>On Fri, 2002-07-12 at 16:59, Lincoln Peters wrote:
>> plan->maingoal->args[0]?  I'll try that.
>
>...and it still segfaults.  During one test run, it gave me a warning
>about a "bad ttype" before crashing, but other than that, all I know is
>that the problem has something to do with the "vanishes on" fix.

You crashed because you used x and y that are uninitialized variables at
this point in the function. So you end up anywhere, most likely outside the
map, which explains the bad ttype warning. You need to use unit->x and
unit->y instead. Thus:

	u2 = plan->maingoal->args[0];
	if (good_cell_to_colonize(unit->x, unit->y)
--->	     && !ut_vanishes_on(u2, terrain_at(unit->x, unit->y))
	    /* Check for nexthere prevents two colonizers from trying to
	       colonize the same cell and blocking each other from doing so
	       again and again due to terrain capacity restrictions. */
	     && unit->nexthere == NULL) {

This works fine and solves the postmodern engineer problem. Except for the
fact that they still walk on water ...

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]