fix bug on how lua detect source paths

This commit is contained in:
Eduardo Bart
2011-05-21 15:40:06 -03:00
parent 80e42b0f96
commit f5a15939b2
9 changed files with 78 additions and 66 deletions

View File

@@ -105,10 +105,11 @@ bool Resources::directoryExists(const std::string& directoryName)
bool Resources::loadFile(const std::string& fileName, std::iostream& out)
{
std::string fullPath = resolvePath(fileName);
out.clear(std::ios::goodbit);
PHYSFS_file *file = PHYSFS_openRead(resolvePath(fileName).c_str());
PHYSFS_file *file = PHYSFS_openRead(fullPath.c_str());
if(!file) {
flogError("ERROR: Failed to load file \"%s\": %s", fileName.c_str() % PHYSFS_getLastError());
flogError("ERROR: Failed to load file \"%s\": %s", fullPath.c_str() % PHYSFS_getLastError());
out.clear(std::ios::failbit);
return false;
} else {