Commit 24bc8c0c authored by nekrozar's avatar nekrozar

fix

parent c8fffbab
......@@ -861,7 +861,7 @@ void Game::SetStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, irr::gu
pControl->setText(dataManager.strBuffer);
}
void Game::LoadExpansionDB() {
LoadExpansionDBDirectry("./expansions")
LoadExpansionDBDirectry("./expansions");
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......@@ -872,7 +872,7 @@ void Game::LoadExpansionDB() {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
LoadExpansionDBDirectry(fpath)
LoadExpansionDBDirectry(fpath);
}
} while(FindNextFileW(fh, &fdataw));
FindClose(fh);
......@@ -882,11 +882,11 @@ void Game::LoadExpansionDB() {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (f->d_type != DT_DIR)
if (dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
LoadExpansionDBDirectry(filepath)
LoadExpansionDBDirectry(filepath);
}
closedir(dir);
}
......@@ -929,7 +929,7 @@ void Game::LoadExpansionDBDirectry(const char* path) {
#endif
}
void Game::LoadExpansionStrings() {
LoadExpansionStringsDirectry("./expansions")
LoadExpansionStringsDirectry("./expansions");
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......@@ -940,7 +940,7 @@ void Game::LoadExpansionStrings() {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
LoadExpansionStringsDirectry(fpath)
LoadExpansionStringsDirectry(fpath);
}
} while(FindNextFileW(fh, &fdataw));
FindClose(fh);
......@@ -950,11 +950,11 @@ void Game::LoadExpansionStrings() {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (f->d_type != DT_DIR)
if (dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
LoadExpansionStringsDirectry(filepath)
LoadExpansionStringsDirectry(filepath);
}
closedir(dir);
}
......
......@@ -935,8 +935,8 @@ void ReplayMode::ReplayReload() {
/*len = */query_field_card(pduel, 1, LOCATION_REMOVED, flag, queryBuffer, 0);
mainGame->dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_REMOVED, (char*)queryBuffer);
}
byte* ReplayMode::::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen)
byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen);
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......@@ -947,7 +947,7 @@ byte* ReplayMode::::ScriptReaderEx(const char* script_name, int* slen) {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -959,11 +959,11 @@ byte* ReplayMode::::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (f->d_type != DT_DIR)
if (dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -973,7 +973,8 @@ byte* ReplayMode::::ScriptReaderEx(const char* script_name, int* slen) {
return default_script_reader(script_name, slen);
}
byte* ReplayMode::ScriptReaderExDirectry(const char* path, const char* script_name, int* slen) {
char sname[256] = path;
char sname[256];
strcpy(sname, path);
strcat(sname, script_name + 1);//default script name: ./script/c%d.lua
return default_script_reader(sname, slen);
}
......
......@@ -1545,8 +1545,8 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
NetServer::ReSendToPlayer(*pit);
}
}
byte* SingleDuel::::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen)
byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen);
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......@@ -1557,7 +1557,7 @@ byte* SingleDuel::::ScriptReaderEx(const char* script_name, int* slen) {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -1569,11 +1569,11 @@ byte* SingleDuel::::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (f->d_type != DT_DIR)
if (dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -1583,7 +1583,8 @@ byte* SingleDuel::::ScriptReaderEx(const char* script_name, int* slen) {
return default_script_reader(script_name, slen);
}
byte* SingleDuel::ScriptReaderExDirectry(const char* path, const char* script_name, int* slen) {
char sname[256] = path;
char sname[256];
strcpy(sname, path);
strcat(sname, script_name + 1);//default script name: ./script/c%d.lua
return default_script_reader(sname, slen);
}
......
......@@ -845,8 +845,8 @@ void SingleMode::SinglePlayReload() {
/*len = */query_field_card(pduel, 1, LOCATION_REMOVED, flag, queryBuffer, 0);
mainGame->dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_REMOVED, (char*)queryBuffer);
}
byte* SingleMode::::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen)
byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen);
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......@@ -857,7 +857,7 @@ byte* SingleMode::::ScriptReaderEx(const char* script_name, int* slen) {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -869,11 +869,11 @@ byte* SingleMode::::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (f->d_type != DT_DIR)
if (dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen);
if(buffer)
return buffer;
}
......
......@@ -1663,8 +1663,8 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
}
}
byte* TagDuel::::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen)
byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) {
ScriptReaderExDirectry("./expansions", script_name, slen);
#ifdef _WIN32
char fpath[1000];
WIN32_FIND_DATAW fdataw;
......@@ -1675,7 +1675,7 @@ byte* TagDuel::::ScriptReaderEx(const char* script_name, int* slen) {
char fname[780];
BufferIO::EncodeUTF8(fdataw.cFileName, fname);
sprintf(fpath, "./expansions/%s", fname);
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(fpath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -1687,11 +1687,11 @@ byte* TagDuel::::ScriptReaderEx(const char* script_name, int* slen) {
struct dirent * dirp;
if((dir = opendir("./expansions/")) != NULL) {
while((dirp = readdir(dir)) != NULL) {
if (f->d_type != DT_DIR)
if (dirp->d_type != DT_DIR)
continue;
char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name);
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen)
byte* buffer = ScriptReaderExDirectry(filepath, script_name, slen);
if(buffer)
return buffer;
}
......@@ -1701,7 +1701,8 @@ byte* TagDuel::::ScriptReaderEx(const char* script_name, int* slen) {
return default_script_reader(script_name, slen);
}
byte* TagDuel::ScriptReaderExDirectry(const char* path, const char* script_name, int* slen) {
char sname[256] = path;
char sname[256];
strcpy(sname, path);
strcat(sname, script_name + 1);//default script name: ./script/c%d.lua
return default_script_reader(sname, slen);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment