mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
new logger
scripts are now more error prone
This commit is contained in:
@@ -44,14 +44,14 @@ bool Resources::setWriteDir(const std::string& path)
|
||||
bool ret = (bool)PHYSFS_setWriteDir(path.c_str());
|
||||
|
||||
if(!ret)
|
||||
logError("Could not set the path \"%s\" as write directory, file write will not work correctly.", path.c_str());
|
||||
flogError("ERROR: Could not set the path \"%s\" as write directory, file write will not work correctly.", path.c_str());
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Resources::addToSearchPath(const std::string& path, bool insertInFront /*= true*/)
|
||||
{
|
||||
if(!PHYSFS_addToSearchPath(path.c_str(), insertInFront ? 0 : 1)) {
|
||||
logError("Error while adding \"%s\" to resources search path: %s", path.c_str(), PHYSFS_getLastError());
|
||||
flogError("ERROR: Error while adding \"%s\" to resources search path: %s", path.c_str() % PHYSFS_getLastError());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -66,7 +66,7 @@ uchar *Resources::loadFile(const std::string& fileName, uint *fileSize)
|
||||
{
|
||||
PHYSFS_file *file = PHYSFS_openRead(fileName.c_str());
|
||||
if(!file) {
|
||||
logError("Failed to load file \"%s\": %s", fileName.c_str(), PHYSFS_getLastError());
|
||||
flogError("ERROR: Failed to load file \"%s\": %s", fileName.c_str() % PHYSFS_getLastError());
|
||||
*fileSize = 0;
|
||||
return NULL;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ bool Resources::saveFile(const std::string &fileName, const uchar *data, uint si
|
||||
{
|
||||
PHYSFS_file *file = PHYSFS_openWrite(fileName.c_str());
|
||||
if(!file) {
|
||||
logError("Failed to save file \"%s\": %s", fileName.c_str(), PHYSFS_getLastError());
|
||||
flogError("ERROR: Failed to save file \"%s\": %s", fileName.c_str() % PHYSFS_getLastError());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user