Commit 99ee40e4 authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/Fluorohydride/ygopro into server

parents 9717a572 6700122a
...@@ -374,6 +374,7 @@ void ClientField::ClearChainSelect() { ...@@ -374,6 +374,7 @@ void ClientField::ClearChainSelect() {
(*cit)->is_selected = false; (*cit)->is_selected = false;
} }
conti_cards.clear(); conti_cards.clear();
deck_act = false;
grave_act = false; grave_act = false;
remove_act = false; remove_act = false;
extra_act = false; extra_act = false;
......
...@@ -774,15 +774,6 @@ void DeckBuilder::StartFilter() { ...@@ -774,15 +774,6 @@ void DeckBuilder::StartFilter() {
void DeckBuilder::FilterCards() { void DeckBuilder::FilterCards() {
results.clear(); results.clear();
const wchar_t* pstr = mainGame->ebCardName->getText(); const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = BufferIO::GetVal(pstr);
if(dataManager.GetData(trycode, 0)) {
auto ptr = dataManager.GetCodePointer(trycode); // verified by GetData()
results.push_back(ptr);
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
myswprintf(result_string, L"%d", results.size());
return;
}
unsigned int set_code = 0; unsigned int set_code = 0;
if(pstr[0] == L'@') if(pstr[0] == L'@')
set_code = dataManager.GetSetCode(&pstr[1]); set_code = dataManager.GetSetCode(&pstr[1]);
...@@ -870,9 +861,14 @@ void DeckBuilder::FilterCards() { ...@@ -870,9 +861,14 @@ void DeckBuilder::FilterCards() {
} else if(pstr[0] == L'@' && set_code) { } else if(pstr[0] == L'@' && set_code) {
if(!check_set_code(data, set_code)) continue; if(!check_set_code(data, set_code)) continue;
} else { } else {
if(!CardNameContains(text.name.c_str(), pstr) && text.text.find(pstr) == std::wstring::npos int trycode = BufferIO::GetVal(pstr);
bool tryresult = dataManager.GetData(trycode, 0);
if(!tryresult && !CardNameContains(text.name.c_str(), pstr) && text.text.find(pstr) == std::wstring::npos
&& (!set_code || !check_set_code(data, set_code))) && (!set_code || !check_set_code(data, set_code)))
continue; continue;
if (tryresult && data.code != trycode
&& !(data.alias == trycode && (data.alias - data.code < CARD_ARTWORK_VERSIONS_OFFSET || data.code - data.alias < CARD_ARTWORK_VERSIONS_OFFSET)))
continue;
} }
} }
results.push_back(ptr); results.push_back(ptr);
......
...@@ -1518,7 +1518,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1518,7 +1518,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard->cmdFlag |= COMMAND_RESET; pcard->cmdFlag |= COMMAND_RESET;
else else
pcard->cmdFlag |= COMMAND_ACTIVATE; pcard->cmdFlag |= COMMAND_ACTIVATE;
if(l == LOCATION_GRAVE) if(pcard->location == LOCATION_DECK) {
pcard->SetCode(code);
mainGame->dField.deck_act = true;
} else if(l == LOCATION_GRAVE)
mainGame->dField.grave_act = true; mainGame->dField.grave_act = true;
else if(l == LOCATION_REMOVED) else if(l == LOCATION_REMOVED)
mainGame->dField.remove_act = true; mainGame->dField.remove_act = true;
......
...@@ -744,7 +744,7 @@ void Game::MainLoop() { ...@@ -744,7 +744,7 @@ void Game::MainLoop() {
atkdy = (float)sin(atkframe); atkdy = (float)sin(atkframe);
driver->beginScene(true, true, SColor(0, 0, 0, 0)); driver->beginScene(true, true, SColor(0, 0, 0, 0));
gMutex.Lock(); gMutex.Lock();
if(dInfo.isStarted || dInfo.isReplaySkiping) { if(dInfo.isStarted) {
if(dInfo.isFinished && showcardcode == 1) if(dInfo.isFinished && showcardcode == 1)
soundManager.PlayBGM(BGM_WIN); soundManager.PlayBGM(BGM_WIN);
else if(dInfo.isFinished && (showcardcode == 2 || showcardcode == 3)) else if(dInfo.isFinished && (showcardcode == 2 || showcardcode == 3))
...@@ -1248,7 +1248,7 @@ void Game::ShowCardInfo(int code) { ...@@ -1248,7 +1248,7 @@ void Game::ShowCardInfo(int code) {
memset(&cd, 0, sizeof(CardData)); memset(&cd, 0, sizeof(CardData));
imgCard->setImage(imageManager.GetTexture(code)); imgCard->setImage(imageManager.GetTexture(code));
imgCard->setScaleImage(true); imgCard->setScaleImage(true);
if(cd.alias != 0 && (cd.alias - code < 10 || code - cd.alias < 10)) if(cd.alias != 0 && (cd.alias - code < CARD_ARTWORK_VERSIONS_OFFSET || code - cd.alias < CARD_ARTWORK_VERSIONS_OFFSET))
myswprintf(formatBuffer, L"%ls[%08d]", dataManager.GetName(cd.alias), cd.alias); myswprintf(formatBuffer, L"%ls[%08d]", dataManager.GetName(cd.alias), cd.alias);
else myswprintf(formatBuffer, L"%ls[%08d]", dataManager.GetName(code), code); else myswprintf(formatBuffer, L"%ls[%08d]", dataManager.GetName(code), code);
stName->setText(formatBuffer); stName->setText(formatBuffer);
......
...@@ -644,4 +644,6 @@ extern HostInfo game_info; ...@@ -644,4 +644,6 @@ extern HostInfo game_info;
#define BUTTON_MARKERS_OK 381 #define BUTTON_MARKERS_OK 381
#define DEFAULT_DUEL_RULE 4 #define DEFAULT_DUEL_RULE 4
#define CARD_ARTWORK_VERSIONS_OFFSET 10
#endif // GAME_H #endif // GAME_H
...@@ -106,6 +106,7 @@ int ReplayMode::ReplayThread(void* param) { ...@@ -106,6 +106,7 @@ int ReplayMode::ReplayThread(void* param) {
get_message(pduel, (byte*)engineBuffer); get_message(pduel, (byte*)engineBuffer);
is_continuing = ReplayAnalyze(engineBuffer, len); is_continuing = ReplayAnalyze(engineBuffer, len);
if(is_restarting) { if(is_restarting) {
mainGame->gMutex.Lock();
is_restarting = false; is_restarting = false;
int step = current_step - 1; int step = current_step - 1;
if(step < 0) if(step < 0)
...@@ -280,7 +281,6 @@ void ReplayMode::Undo() { ...@@ -280,7 +281,6 @@ void ReplayMode::Undo() {
return; return;
mainGame->dInfo.isReplaySkiping = true; mainGame->dInfo.isReplaySkiping = true;
Restart(false); Restart(false);
mainGame->gMutex.Lock();
Pause(false, false); Pause(false, false);
} }
bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
......
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