Commit f870835b authored by edo9300's avatar edo9300

Fix double deck loading

parent 88c0dcf1
...@@ -260,12 +260,7 @@ bool DeckManager::LoadDeckDouble(const wchar_t* file, const wchar_t* file2) { ...@@ -260,12 +260,7 @@ bool DeckManager::LoadDeckDouble(const wchar_t* file, const wchar_t* file2) {
if(!fp || !fp2) if(!fp || !fp2)
return false; return false;
char linebuf[256]; char linebuf[256];
fseek(fp, 0, SEEK_END); while(fgets(linebuf, 256, fp) && ct < 128) {
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
fgets(linebuf, 256, fp);
while(ftell(fp) < fsize && ct < 128) {
fgets(linebuf, 256, fp);
if(linebuf[0] == '!') { if(linebuf[0] == '!') {
is_side = true; is_side = true;
continue; continue;
...@@ -282,12 +277,7 @@ bool DeckManager::LoadDeckDouble(const wchar_t* file, const wchar_t* file2) { ...@@ -282,12 +277,7 @@ bool DeckManager::LoadDeckDouble(const wchar_t* file, const wchar_t* file2) {
} }
fclose(fp); fclose(fp);
is_side = false; is_side = false;
fseek(fp2, 0, SEEK_END); while(fgets(linebuf, 256, fp2) && ct < 128) {
int fsize2 = ftell(fp2);
fseek(fp2, 0, SEEK_SET);
fgets(linebuf, 256, fp2);
while(ftell(fp2) < fsize2 && ct < 128) {
fgets(linebuf, 256, fp2);
if(linebuf[0] == '!') { if(linebuf[0] == '!') {
is_side = true; is_side = true;
continue; continue;
......
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