04-24-2015, 06:56 PM
(04-24-2015, 06:49 PM)xoft Wrote: Let the mob pass a cWorld instance to the pathfinder via a special function that will be called whenever the mob's world changes (mob goes through a portal); this function should also reset all the pathfinding progress so far etc.
EDIT: Note that you can't pass the cWorld instance through the constructor, because at the time of construction the mob has no world assigned to it yet. The world is assigned in the cMonster::Initialize() function.
Or the pathfinder can take a cWorld in its constructor, and the mob can just not construct one until its initialize call. The mob can also construct a new one each time it switches world. That would simplify the pathfinder a lot.
Also can we switch DoWithChunk over to using a lambda function? It would be easier to use than the current functor classes system and there is only one other user.