fixed stupid path bugs!
This commit is contained in:
parent
b3b9e72b01
commit
c69777d8cc
@ -168,10 +168,11 @@ void ParseAndOrAdd(CStack<String *> & files, const char *name)
|
|||||||
|
|
||||||
void BuildPluginFileList(CStack<String *> & files)
|
void BuildPluginFileList(CStack<String *> & files)
|
||||||
{
|
{
|
||||||
const char *pluginsDir = get_localinfo("amxx_configsdir", "addons/amxmodx/configs");
|
char path[255];
|
||||||
|
build_pathname_r(path, sizeof(path)-1, "%s/", get_localinfo("amxx_configsdir", "addons/amxmodx/configs"));
|
||||||
#if defined WIN32
|
#if defined WIN32
|
||||||
_finddata_t fd;
|
_finddata_t fd;
|
||||||
intptr_t handle = _findfirst(pluginsDir, &fd);
|
intptr_t handle = _findfirst(path, &fd);
|
||||||
|
|
||||||
if (handle < 0)
|
if (handle < 0)
|
||||||
return;
|
return;
|
||||||
@ -186,7 +187,7 @@ void BuildPluginFileList(CStack<String *> & files)
|
|||||||
struct dirent *ep;
|
struct dirent *ep;
|
||||||
DIR *dp;
|
DIR *dp;
|
||||||
|
|
||||||
if ((dp = opendir(pluginsDir)) == NULL)
|
if ((dp = opendir(path)) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while ( (ep=readdir(dp)) != NULL )
|
while ( (ep=readdir(dp)) != NULL )
|
||||||
@ -317,7 +318,9 @@ int C_Spawn(edict_t *pent)
|
|||||||
while (!files.empty())
|
while (!files.empty())
|
||||||
{
|
{
|
||||||
String *pString = files.front();
|
String *pString = files.front();
|
||||||
snprintf(path, sizeof(path)-1, "%s/%s", get_localinfo("amxx_configsdir", "addons/amxmodx/configs"));
|
snprintf(path, sizeof(path)-1, "%s/%s",
|
||||||
|
get_localinfo("amxx_configsdir", "addons/amxmodx/configs"),
|
||||||
|
pString->c_str());
|
||||||
g_plugins.CALMFromFile(path);
|
g_plugins.CALMFromFile(path);
|
||||||
delete pString;
|
delete pString;
|
||||||
files.pop();
|
files.pop();
|
||||||
@ -363,7 +366,9 @@ int C_Spawn(edict_t *pent)
|
|||||||
while (!files.empty())
|
while (!files.empty())
|
||||||
{
|
{
|
||||||
String *pString = files.front();
|
String *pString = files.front();
|
||||||
snprintf(path, sizeof(path)-1, "%s/%s", get_localinfo("amxx_configsdir", "addons/amxmodx/configs"));
|
snprintf(path, sizeof(path)-1, "%s/%s",
|
||||||
|
get_localinfo("amxx_configsdir", "addons/amxmodx/configs"),
|
||||||
|
pString->c_str());
|
||||||
g_plugins.loadPluginsFromFile(path);
|
g_plugins.loadPluginsFromFile(path);
|
||||||
delete pString;
|
delete pString;
|
||||||
files.pop();
|
files.pop();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user