Commit 1e1fb28e authored by nanahira's avatar nanahira

preload scripts later

parent d4d4daa3
......@@ -167,8 +167,6 @@ bool ReplayMode::StartDuel() {
cur_replay.ReadName(mainGame->dInfo.clientname);
}
pduel = create_duel(rnd());
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
int start_lp = cur_replay.ReadInt32();
int start_hand = cur_replay.ReadInt32();
int draw_count = cur_replay.ReadInt32();
......@@ -177,6 +175,8 @@ bool ReplayMode::StartDuel() {
mainGame->dInfo.duel_rule = duel_rule;
set_player_info(pduel, 0, start_lp, start_hand, draw_count);
set_player_info(pduel, 1, start_lp, start_hand, draw_count);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
mainGame->dInfo.lp[0] = start_lp;
mainGame->dInfo.lp[1] = start_lp;
mainGame->dInfo.start_lp = start_lp;
......
......@@ -439,10 +439,10 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
set_card_reader(DataManager::CardReader);
set_message_handler(SingleDuel::MessageHandler);
pduel = create_duel(duel_seed);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
int opt = (int)host_info.duel_rule << 16;
if(host_info.no_shuffle_deck)
opt |= DUEL_PSEUDO_SHUFFLE;
......
......@@ -41,10 +41,10 @@ int SingleMode::SinglePlayThread() {
set_card_reader(DataManager::CardReader);
set_message_handler(SingleMode::MessageHandler);
pduel = create_duel(rnd.rand());
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
set_player_info(pduel, 0, start_lp, start_hand, draw_count);
set_player_info(pduel, 1, start_lp, start_hand, draw_count);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
mainGame->dInfo.lp[0] = start_lp;
mainGame->dInfo.lp[1] = start_lp;
mainGame->dInfo.start_lp = start_lp;
......
......@@ -416,10 +416,10 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
set_card_reader(DataManager::CardReader);
set_message_handler(TagDuel::MessageHandler);
pduel = create_duel(duel_seed);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
preload_script(pduel, "./script/special.lua", 0);
preload_script(pduel, "./script/init.lua", 0);
int opt = (int)host_info.duel_rule << 16;
if(host_info.no_shuffle_deck)
opt |= DUEL_PSEUDO_SHUFFLE;
......
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