Browse Source

Merge pull request #395 from AtomicGameEngine/JME-ATOMIC-321

Fix issue with nested paths
JoshEngebretson 10 years ago
parent
commit
4b369a0f17
2 changed files with 7 additions and 7 deletions
  1. 1 6
      Source/Atomic/Scene/PrefabComponent.cpp
  2. 6 1
      Source/ToolCore/ToolSystem.cpp

+ 1 - 6
Source/Atomic/Scene/PrefabComponent.cpp

@@ -51,12 +51,7 @@ void PrefabComponent::LoadPrefabNode()
 {
     ResourceCache* cache = GetSubsystem<ResourceCache>();
 
-    // first look in cache
-    XMLFile* xmlfile = cache->GetResource<XMLFile>("Cache/" + prefabGUID_, false);
-
-    // if not found, could be loading a specific prefab
-    if (!xmlfile)
-        xmlfile = cache->GetResource<XMLFile>(prefabGUID_, false);
+    XMLFile* xmlfile = cache->GetResource<XMLFile>(prefabGUID_, false);
 
     if (!xmlfile || !node_)
         return;

+ 6 - 1
Source/ToolCore/ToolSystem.cpp

@@ -80,7 +80,12 @@ bool ToolSystem::LoadProject(const String& fullpath)
     }
 
     ResourceCache* cache = GetSubsystem<ResourceCache>();
-    cache->AddResourceDir(path, 0);
+
+    // Do NOT add the root project path as a resource path, otherwise
+    // it will introduce a situation where there are nested resource paths
+    // which will confuse the ResourceCache and can cause resources referenced
+    // by various paths to be seen as unique resources
+    //cache->AddResourceDir(path, 0);
 
     String resourcePath = path;
     resourcePath += "/Resources";