Преглед изворни кода

Fixed bug that was causing assets to fail to load when specifying a path from root in script

Tim Newell пре 12 година
родитељ
комит
a78ea62831
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      engine/source/console/console.cc

+ 6 - 2
engine/source/console/console.cc

@@ -1534,11 +1534,15 @@ bool expandPath( char* pDstPath, U32 size, const char* pSrcPath, const char* pWo
         return true;
     }
 
+    // All else.
+
     //Using a special case here because the code below barfs on trying to build a full path for apk reading
  #ifdef TORQUE_OS_ANDROID
- 	   dSprintf(pathBuffer, sizeof(pathBuffer), "/%s", pSrcPath);
+    	if (leadingToken == '/' || strstr(pSrcPath, "/") == NULL)
+    		Platform::makeFullPathName( pSrcPath, pathBuffer, sizeof(pathBuffer), pWorkingDirectoryHint );
+    	else
+    		dSprintf(pathBuffer, sizeof(pathBuffer), "/%s", pSrcPath);
 #else
- 	  // All else.
  	  Platform::makeFullPathName( pSrcPath, pathBuffer, sizeof(pathBuffer), pWorkingDirectoryHint );
 #endif