Commit 3bce6d6d authored by nanahira's avatar nanahira

Merge branch 'subdir' into server_subdir

parents 312c981e 7469eb68
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
#include "network.h" #include "network.h"
#include "game.h" #include "game.h"
#include <algorithm> #include <algorithm>
#ifndef _WIN32
#include <dirent.h>
#endif
namespace ygo { namespace ygo {
......
...@@ -940,8 +940,7 @@ void ReplayMode::ReplayReload() { ...@@ -940,8 +940,7 @@ void ReplayMode::ReplayReload() {
mainGame->dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_REMOVED, (char*)queryBuffer); mainGame->dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_REMOVED, (char*)queryBuffer);
} }
byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) { byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) {
byte* buffer; byte* buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
if(buffer) if(buffer)
return buffer; return buffer;
buffer = ScriptReaderExDirectry("./expansions", script_name, slen); buffer = ScriptReaderExDirectry("./expansions", script_name, slen);
...@@ -976,7 +975,7 @@ byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -976,7 +975,7 @@ byte* ReplayMode::ScriptReaderEx(const char* script_name, int* slen) {
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
buffer = ScriptReaderExDirectry(fpath, script_name, slen); buffer = ScriptReaderExDirectry(filepath, script_name, slen);
if(buffer) if(buffer)
return buffer; return buffer;
} }
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#include "../ocgcore/ocgapi.h" #include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h" #include "../ocgcore/common.h"
#include "../ocgcore/mtrandom.h" #include "../ocgcore/mtrandom.h"
#ifndef _WIN32
#include <dirent.h>
#endif
namespace ygo { namespace ygo {
...@@ -2123,8 +2126,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag) ...@@ -2123,8 +2126,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
} }
} }
byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) { byte* SingleDuel::ScriptReaderEx(const char* script_name, int* slen) {
byte* buffer; byte* buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
if(buffer) if(buffer)
return buffer; return buffer;
buffer = ScriptReaderExDirectry("./expansions", script_name, slen); buffer = ScriptReaderExDirectry("./expansions", script_name, slen);
......
...@@ -860,8 +860,7 @@ void SingleMode::SinglePlayReload() { ...@@ -860,8 +860,7 @@ void SingleMode::SinglePlayReload() {
mainGame->dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_REMOVED, (char*)queryBuffer); mainGame->dField.UpdateFieldCard(mainGame->LocalPlayer(1), LOCATION_REMOVED, (char*)queryBuffer);
} }
byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) { byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) {
byte* buffer; byte* buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
if(buffer) if(buffer)
return buffer; return buffer;
buffer = ScriptReaderExDirectry("./expansions", script_name, slen); buffer = ScriptReaderExDirectry("./expansions", script_name, slen);
...@@ -896,7 +895,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -896,7 +895,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) {
continue; continue;
char filepath[1000]; char filepath[1000];
sprintf(filepath, "./expansions/%s/", dirp->d_name); sprintf(filepath, "./expansions/%s/", dirp->d_name);
buffer = ScriptReaderExDirectry(fpath, script_name, slen); buffer = ScriptReaderExDirectry(filepath, script_name, slen);
if(buffer) if(buffer)
return buffer; return buffer;
} }
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
#include "../ocgcore/ocgapi.h" #include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h" #include "../ocgcore/common.h"
#include "../ocgcore/mtrandom.h" #include "../ocgcore/mtrandom.h"
#ifndef _WIN32
#include <dirent.h>
#endif
namespace ygo { namespace ygo {
...@@ -2283,8 +2286,7 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) { ...@@ -2283,8 +2286,7 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) {
} }
byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) { byte* TagDuel::ScriptReaderEx(const char* script_name, int* slen) {
byte* buffer; byte* buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
buffer = ScriptReaderExDirectry("./specials", script_name, slen, 8);
if(buffer) if(buffer)
return buffer; return buffer;
buffer = ScriptReaderExDirectry("./expansions", script_name, slen); buffer = ScriptReaderExDirectry("./expansions", script_name, 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