Commit 8af6db19 authored by argon.sun's avatar argon.sun

fix

parent e8edb598
...@@ -1996,8 +1996,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) { ...@@ -1996,8 +1996,7 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
int code = BufferIO::ReadInt32(pbuf); int code = BufferIO::ReadInt32(pbuf);
pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1 - i); pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1 - i);
if(code) pcard->SetCode(code);
pcard->SetCode(code);
} }
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <event2/thread.h> #include <event2/thread.h>
bool enable_log = false; bool enable_log = false;
bool exit_on_return = false; bool exit_on_return = false;
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
#ifdef _WIN32 #ifdef _WIN32
...@@ -19,38 +19,38 @@ int main(int argc, char* argv[]) { ...@@ -19,38 +19,38 @@ int main(int argc, char* argv[]) {
ygo::mainGame = &_game; ygo::mainGame = &_game;
if(!ygo::mainGame->Initialize()) if(!ygo::mainGame->Initialize())
return 0; return 0;
if(argc >= 2) if(argc >= 2)
if(!strcmp(argv[1], "-debug")) if(!strcmp(argv[1], "-debug"))
enable_log = true; enable_log = true;
/*command line args: /*command line args:
* -j: join host (host info from system.conf) * -j: join host (host info from system.conf)
* -d: deck edit * -d: deck edit
* -r: replay */ * -r: replay */
else if(!strcmp(argv[1], "-j") or !strcmp(argv[1], "-d") or !strcmp(argv[1], "-r")){ else if(!strcmp(argv[1], "-j") or !strcmp(argv[1], "-d") or !strcmp(argv[1], "-r")) {
exit_on_return = true; exit_on_return = true;
irr::SEvent event; irr::SEvent event;
event.EventType = irr::EET_GUI_EVENT; event.EventType = irr::EET_GUI_EVENT;
event.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED; event.GUIEvent.EventType = irr::gui::EGET_BUTTON_CLICKED;
if(!strcmp(argv[1], "-j")){ if(!strcmp(argv[1], "-j")) {
event.GUIEvent.Caller = ygo::mainGame->btnLanMode; event.GUIEvent.Caller = ygo::mainGame->btnLanMode;
ygo::mainGame->device->postEventFromUser(event); ygo::mainGame->device->postEventFromUser(event);
event.GUIEvent.Caller = ygo::mainGame->btnJoinHost; event.GUIEvent.Caller = ygo::mainGame->btnJoinHost;
ygo::mainGame->device->postEventFromUser(event); ygo::mainGame->device->postEventFromUser(event);
}else if(!strcmp(argv[1], "-d")){ } else if(!strcmp(argv[1], "-d")) {
event.GUIEvent.Caller = ygo::mainGame->btnDeckEdit; event.GUIEvent.Caller = ygo::mainGame->btnDeckEdit;
ygo::mainGame->device->postEventFromUser(event); ygo::mainGame->device->postEventFromUser(event);
}else if(!strcmp(argv[1], "-r")){ } else if(!strcmp(argv[1], "-r")) {
event.GUIEvent.Caller = ygo::mainGame->btnReplayMode; event.GUIEvent.Caller = ygo::mainGame->btnReplayMode;
ygo::mainGame->device->postEventFromUser(event); ygo::mainGame->device->postEventFromUser(event);
ygo::mainGame->lstReplayList->setSelected(0); ygo::mainGame->lstReplayList->setSelected(0);
event.GUIEvent.Caller = ygo::mainGame->btnLoadReplay; event.GUIEvent.Caller = ygo::mainGame->btnLoadReplay;
} }
} }
ygo::mainGame->MainLoop(); ygo::mainGame->MainLoop();
#ifdef _WIN32 #ifdef _WIN32
WSACleanup(); WSACleanup();
#else #else
#endif //_WIN32 #endif //_WIN32
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
...@@ -135,7 +135,12 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -135,7 +135,12 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
mainGame->dInfo.curMsg = BufferIO::ReadUInt8(pbuf); mainGame->dInfo.curMsg = BufferIO::ReadUInt8(pbuf);
switch (mainGame->dInfo.curMsg) { switch (mainGame->dInfo.curMsg) {
case MSG_RETRY: { case MSG_RETRY: {
DuelClient::ClientAnalyze(offset, pbuf - offset); mainGame->gMutex.Lock();
mainGame->stMessage->setText(L"Error occurs.");
mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.Unlock();
mainGame->actionSignal.Reset();
mainGame->actionSignal.Wait();
return false; return false;
} }
case MSG_HINT: { case MSG_HINT: {
......
...@@ -897,7 +897,7 @@ int32 scriptlib::card_is_relate_to_battle(lua_State *L) { ...@@ -897,7 +897,7 @@ int32 scriptlib::card_is_relate_to_battle(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
duel* pduel = pcard->pduel; duel* pduel = pcard->pduel;
if(pcard->fieldid_r == pduel->game_field->core.pre_field[0] || pcard->fieldid == pduel->game_field->core.pre_field[1]) if(pcard->fieldid_r == pduel->game_field->core.pre_field[0] || pcard->fieldid_r == pduel->game_field->core.pre_field[1])
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
else else
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
......
...@@ -2804,7 +2804,6 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2804,7 +2804,6 @@ int32 field::process_battle_command(uint16 step) {
reset_phase(PHASE_DAMAGE); reset_phase(PHASE_DAMAGE);
adjust_instant(); adjust_instant();
adjust_all(); adjust_all();
core.units.begin()->step = 19;
return FALSE; return FALSE;
} }
case 20: { case 20: {
......
...@@ -29,7 +29,7 @@ end ...@@ -29,7 +29,7 @@ end
function c10000040.spcon(e,c) function c10000040.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return true or Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000000) return Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000000)
and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000010) and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000010)
and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000020) and Duel.CheckReleaseGroup(tp,c10000040.spfilter,1,nil,10000020)
end end
......
...@@ -16,7 +16,7 @@ function c1498130.tgcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -16,7 +16,7 @@ function c1498130.tgcon(e,tp,eg,ep,ev,re,r,rp)
if not g or g:GetCount()~=1 then return false end if not g or g:GetCount()~=1 then return false end
local tg=g:GetFirst() local tg=g:GetFirst()
local c=e:GetHandler() local c=e:GetHandler()
if tg==c or tg:GetControler()~=tp or tg:IsFacedown() or or not tg:IsLocation(LOCATION_MZONE) or not tg:IsSetCard(0x3d) then return false end if tg==c or tg:GetControler()~=tp or tg:IsFacedown() or not tg:IsLocation(LOCATION_MZONE) or not tg:IsSetCard(0x3d) then return false end
local tf=re:GetTarget() local tf=re:GetTarget()
return tf(re,rp,nil,nil,nil,nil,nil,nil,0,c) return tf(re,rp,nil,nil,nil,nil,nil,nil,0,c)
end end
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
antialias = 2 antialias = 2
nickname = Player nickname = Player
gamename = Game gamename = Game
lastdeck = chaosls lastdeck = sixsamurai
textfont = c:/windows/fonts/simsun.ttc 14 textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911 serverport = 7911
......
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