Notice: If the game stops working after an update, it might be a savegame incompatibility. Remove your savegame folder and try again before posting about it.
Registration has an extra hurdle now: There have been advertisement bots, so I added a security keyword to registration. Deal with it.
  0 users browsing Bug Reports. | 1 bot  
Main » Bug Reports » Pathing bug inside MoveTo
Pages: 1
Posted on 03-19-13, 09:00 am (revision 1)

 

Posts: 82/105
Since: 12-06-12

Last post: 4021 days
Last view: 4002 days
Jesus, this took me forever to figure out!

I finally discovered why some of the Boardchars kept trying to run into walls whenever MoveTo was called by the scheduler.

ScriptPathTarget = new Dijkstra(); <- It was this bastard!
ScriptPathTarget.Hotspots.Add(new Point(x, y));
ScriptPathTarget.Update();
ScriptPathID = target;
ScriptPathTargetX = x;
ScriptPathTargetY = y;
ScriptPathing = true;


When the constructor was being called without a board being passed, it caused UpdateWalls to try and update using some empty board. This meant that the as far as the mapper was concerned, the entity was in an open field, and hence why it couldn't see the wall in front of its face.

The fix is of course maddeningly simple:
ScriptPathTarget = new Dijkstra(this.ParentBoard);

And so now, entities that are told to move by MoveTo, can now actually go where they need to be. Now if you'll excuse me, I need to go to bed. x_x

Lead writer on Noxico (and sometimes programmer or designer) <br>
Pages: 1
Main » Bug Reports » Pathing bug inside MoveTo