Commit cdc39647 authored by nanahira's avatar nanahira

Merge branch 'patch-overflow' of github.com:salix5/ygopro into develop-20240617

parents eb1f11b4 17505759
......@@ -31,7 +31,6 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <locale.h>
#define SD_BOTH 2
#define SOCKET int
......
......@@ -242,6 +242,8 @@ bool DeckManager::LoadDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGUICom
bool res = LoadDeck(filepath, is_packlist);
if(res && mainGame->is_building)
mainGame->deckBuilder.RefreshPackListScroll();
if (!res)
current_deck.clear();
return res;
}
FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
......@@ -280,8 +282,8 @@ bool DeckManager::LoadDeck(const wchar_t* file, bool is_packlist) {
}
if(!reader)
return false;
size_t size = reader->getSize();
if(size >= 0x20000) {
auto size = reader->getSize();
if(size >= (int)sizeof deckBuffer) {
reader->drop();
return false;
}
......@@ -296,7 +298,7 @@ bool DeckManager::LoadDeck(std::istringstream* deckStream, bool is_packlist) {
int cardlist[300];
bool is_side = false;
std::string linebuf;
while(std::getline(*deckStream, linebuf) && ct < 300) {
while(std::getline(*deckStream, linebuf, '\n') && ct < 300) {
if(linebuf[0] == '!') {
is_side = true;
continue;
......
......@@ -2,6 +2,7 @@
#include "game.h"
#include "data_manager.h"
#include <event2/thread.h>
#include <locale.h>
#include <memory>
#ifdef __APPLE__
#import <CoreFoundation/CoreFoundation.h>
......
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