From 62bd9ee7f8f75e966cd4c52bfcd46fa918b2d162 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 16 Mar 2007 22:09:07 +0000 Subject: [PATCH] fixed various file operations using Path_SM instead of Path_Game --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40642 --- core/smn_filesystem.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/smn_filesystem.cpp b/core/smn_filesystem.cpp index eeb02565..5c6c9f6e 100644 --- a/core/smn_filesystem.cpp +++ b/core/smn_filesystem.cpp @@ -143,7 +143,7 @@ static cell_t sm_OpenFile(IPluginContext *pContext, const cell_t *params) } char realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, realpath, sizeof(realpath), "%s", name); + g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); FILE *pFile = fopen(realpath, mode); if (!pFile) @@ -165,7 +165,7 @@ static cell_t sm_DeleteFile(IPluginContext *pContext, const cell_t *params) } char realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, realpath, sizeof(realpath), "%s", name); + g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); return (unlink(realpath)) ? 0 : 1; } @@ -269,7 +269,7 @@ static cell_t sm_FileExists(IPluginContext *pContext, const cell_t *params) } char realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, realpath, sizeof(realpath), "%s", name); + g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); #ifdef PLATFORM_WINDOWS struct _stat s; if (_stat(realpath, &s) != 0) @@ -311,9 +311,9 @@ static cell_t sm_RenameFile(IPluginContext *pContext, const cell_t *params) } char new_realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, new_realpath, sizeof(new_realpath), "%s", newpath); + g_SourceMod.BuildPath(Path_Game, new_realpath, sizeof(new_realpath), "%s", newpath); char old_realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, old_realpath, sizeof(old_realpath), "%s", oldpath); + g_SourceMod.BuildPath(Path_Game, old_realpath, sizeof(old_realpath), "%s", oldpath); #ifdef PLATFORM_WINDOWS return (MoveFileA(old_realpath, new_realpath)) ? 1 : 0; @@ -333,7 +333,7 @@ static cell_t sm_DirExists(IPluginContext *pContext, const cell_t *params) } char realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, realpath, sizeof(realpath), "%s", name); + g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); #ifdef PLATFORM_WINDOWS struct _stat s; if (_stat(realpath, &s) != 0) @@ -370,7 +370,7 @@ static cell_t sm_FileSize(IPluginContext *pContext, const cell_t *params) } char realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, realpath, sizeof(realpath), "%s", name); + g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); #ifdef PLATFORM_WINDOWS struct _stat s; if (_stat(realpath, &s) != 0) @@ -407,7 +407,7 @@ static cell_t sm_RemoveDir(IPluginContext *pContext, const cell_t *params) } char realpath[PLATFORM_MAX_PATH+1]; - g_SourceMod.BuildPath(Path_SM, realpath, sizeof(realpath), "%s", name); + g_SourceMod.BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); return (rmdir(realpath)) ? 0 : 1; } @@ -516,8 +516,8 @@ REGISTER_NATIVES(filesystem) {"RemoveDir", sm_RemoveDir}, {"WriteFileLine", sm_WriteFileLine}, {"BuildPath", sm_BuildPath}, - {"LogToGame", sm_LogToGame}, - {"LogMessage", sm_LogMessage}, + {"LogToGame", sm_LogToGame}, + {"LogMessage", sm_LogMessage}, {"LogError", sm_LogError}, {NULL, NULL}, };