Commit 7469eb68 authored by nanahira's avatar nanahira

merge

parents dcd83cdb 49c681c1
...@@ -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 {
...@@ -1553,8 +1556,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag) ...@@ -1553,8 +1556,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);
......
...@@ -861,8 +861,7 @@ void SingleMode::SinglePlayReload() { ...@@ -861,8 +861,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);
...@@ -897,7 +896,7 @@ byte* SingleMode::ScriptReaderEx(const char* script_name, int* slen) { ...@@ -897,7 +896,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 {
...@@ -1694,8 +1697,7 @@ void TagDuel::RefreshSingle(int player, int location, int sequence, int flag) { ...@@ -1694,8 +1697,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