From 7a2d595785a61ec874ddc566e0d999495684c2aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Dec 2011 01:30:04 +0300 Subject: Add gm commands to chat autocomplete list (only for gms) --- src/resources/resourcemanager.cpp | 9 ++++----- src/resources/resourcemanager.h | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/resources') 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 ResourceManager::loadTextFile( - const std::string &fileName) +bool ResourceManager::loadTextFile(const std::string &fileName, + std::vector &lines) { int contentsLength; char *fileContents = static_cast( loadFile(fileName, contentsLength)); - std::vector 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 ResourceManager::loadTextFile( lines.push_back(line); free(fileContents); - return lines; + return true; } std::vector 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 loadTextFile(const std::string &fileName); + bool loadTextFile(const std::string &fileName, + std::vector &lines); /** * Retrieves the contents of a text file. -- cgit v1.2.3-60-g2f50