code in adjust_tooling_crossover?
Hans Ronne
hronne@pp.sbbs.se
Sat Jul 13 11:32:00 GMT 2002
>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
More information about the Xconq7
mailing list