summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-12-06 01:30:04 +0300
committerAndrei Karas <akaras@inbox.ru>2011-12-06 01:30:04 +0300
commit7a2d595785a61ec874ddc566e0d999495684c2aa (patch)
treec0b6d8b0137e002eb4847d8ead44562264ad1e18 /src/resources
parent2d452dd8faf2529fda01913b0ab26f4a1f22ef3d (diff)
downloadManaVerse-7a2d595785a61ec874ddc566e0d999495684c2aa.tar.gz
ManaVerse-7a2d595785a61ec874ddc566e0d999495684c2aa.tar.bz2
ManaVerse-7a2d595785a61ec874ddc566e0d999495684c2aa.tar.xz
ManaVerse-7a2d595785a61ec874ddc566e0d999495684c2aa.zip
Add gm commands to chat autocomplete list (only for gms)
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.cpp9
-rw-r--r--src/resources/resourcemanager.h3
2 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index a99ca622e..c7552b9b7 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -634,18 +634,17 @@ bool ResourceManager::copyFile(const std::string &src, const std::string &dst)
return true;
}
-std::vector<std::string> ResourceManager::loadTextFile(
- const std::string &fileName)
+bool ResourceManager::loadTextFile(const std::string &fileName,
+ std::vector<std::string> &lines)
{
int contentsLength;
char *fileContents = static_cast<char*>(
loadFile(fileName, contentsLength));
- std::vector<std::string> lines;
if (!fileContents)
{
logger->log("Couldn't load text file: %s", fileName.c_str());
- return lines;
+ return false;
}
std::istringstream iss(std::string(fileContents, contentsLength));
@@ -655,7 +654,7 @@ std::vector<std::string> ResourceManager::loadTextFile(
lines.push_back(line);
free(fileContents);
- return lines;
+ return true;
}
std::vector<std::string> ResourceManager::loadTextFileLocal(
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index f70fbece4..8cc851cca 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -217,7 +217,8 @@ class ResourceManager
/**
* Retrieves the contents of a text file (PhysFS).
*/
- std::vector<std::string> loadTextFile(const std::string &fileName);
+ bool loadTextFile(const std::string &fileName,
+ std::vector<std::string> &lines);
/**
* Retrieves the contents of a text file.