Merge branch 'master' into tilemapobject/dev

This commit is contained in:
victorlevasseur
2014-09-23 22:32:19 +02:00
2 changed files with 1790 additions and 1273 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -401,6 +401,8 @@ const float SearchContext::sqrt2 = 1.414213562;
}
PathfindingAutomatism::PathfindingAutomatism() :
parentScene(NULL),
sceneManager(NULL),
pathFound(false),
allowDiagonals(true),
acceleration(400),
@@ -422,7 +424,11 @@ PathfindingAutomatism::PathfindingAutomatism() :
void PathfindingAutomatism::MoveTo(RuntimeScene & scene, float x, float y)
{
if ( !sceneManager ) return;
if ( parentScene != &scene ) //Parent scene has changed
{
parentScene = &scene;
sceneManager = parentScene ? &ScenePathfindingObstaclesManager::managers[&scene] : NULL;
}
path.clear();
@@ -685,4 +691,4 @@ bool PathfindingAutomatism::UpdateProperty(const std::string & name, const std::
return true;
}
#endif
#endif