diff -r 6c258b202756 -r d5cc8d0fa899 core/sourcemod.cpp --- a/core/sourcemod.cpp Sat Apr 14 04:19:58 2007 +0000 +++ b/core/sourcemod.cpp Sat Apr 14 04:27:47 2007 +0000 @@ -100,7 +100,21 @@ bool SourceModBase::InitializeSourceMod(char *error, size_t err_max, bool late) { - g_BaseDir.assign(g_SMAPI->GetBaseDir()); + const char *gamepath = g_SMAPI->GetBaseDir(); + + /* Store full path to game */ + g_BaseDir.assign(gamepath); + + /* Store name of game directory by itself */ + size_t len = strlen(gamepath); + for (size_t i = len - 1; i >= 0; i--) + { + if (gamepath[i] == PLATFORM_SEP_CHAR) + { + strncopy(m_ModDir, &gamepath[++i], sizeof(m_ModDir)); + break; + } + } /* Initialize CoreConfig so we can get SourceMod base path properly - this basically parses core.cfg */ g_CoreConfig.Initialize(); @@ -528,6 +542,11 @@ return 0; } +const char *SourceModBase::GetModFolderName() const +{ + return m_ModDir; +} + SMGlobalClass *SMGlobalClass::head = NULL; SMGlobalClass::SMGlobalClass()