Mail Archives: djgpp/1997/07/09/21:04:08
Matt Reiferson wrote:
>
> This A* Pathfinding algorithm I am planning to use in a Warcraft II
> type game, the problem is, it doesn't work.......Sometimes I will be
> able to find the paths but sometimes it gives me SIGSEGV crash
> messages.....NOTE, this program that follows is just a program that
> allows you to place blockades, a start and an end position to find the
> fastest route from one point to another around those obstacles, it
> uses allegro for the graphics, and a specialized version of MikMod,
> because of this you will be unable to recompile the code without
> removing the #include <mikmod.h>.....The line that is faulty (claimed
> by symify is highlighted RED) Here is the symify output:
[snip]
> struct NODE *CheckCLOSED(int tilenum)
> {
> struct NODE *tmp;
>
> tmp=CLOSED->NextNode;
>
> while (tmp != NULL)
> {
> if (tmp->NodeNum == tilenum) <- line in question
> return (tmp);
> else
> tmp=tmp->NextNode;
> }
> return (NULL);
> }
Are CLOSED and CLOSED->NextNode valid pointers? If you're running under
w95, you won't notice if CLOSED is null until you start using it's
garbage data.
Another possibility is that CLOSED or *CLOSED is getting corrupted
elsewhere in your program.
Bill
--
Leave others their otherness.
- Raw text -