Skip to content

Commit 8964d89

Browse files
Merge branch 'master' into server
2 parents 63e9ba0 + f993599 commit 8964d89

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

.ci/assets-locale.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -o errexit
44
source .ci/asset-branch
55
# ygopro-database
66
apt update && apt -y install wget git libarchive-tools sqlite3
7-
git clone --depth=1 -b "$ASSET_BRANCH_NAME" https://code.moenext.com/mycard/ygopro-database
7+
git clone --depth=1 -b master https://code.moenext.com/nanahira/ygopro-database
88
cp -rf ./ygopro-database/locales/$TARGET_LOCALE/strings.conf .
99
cp -rf ./ygopro-database/locales/$TARGET_LOCALE/servers.conf .
1010
rm -f cards.cdb

gframe/replay_mode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ bool ReplayMode::StartDuel() {
183183
BufferIO::EncodeUTF8(cur_replay.players[i].c_str(), player_name_buf_u);
184184
std::snprintf(player_key_buf, sizeof(player_key_buf), "player_name_%d", i);
185185
set_registry_value(pduel, player_key_buf, player_name_buf_u);
186-
std::snprintf(player_key_buf, sizeof(player_key_buf), "player_type_%d", i);
187-
set_registry_value(pduel, player_key_buf, std::to_string(i).c_str());
188186
}
187+
set_registry_value(pduel, "player_type_0", "0");
188+
set_registry_value(pduel, "player_type_1", "1");
189189
mainGame->dInfo.duel_rule = cur_replay.params.duel_flag >> 16;
190190
set_player_info(pduel, 0, cur_replay.params.start_lp, cur_replay.params.start_hand, cur_replay.params.draw_count);
191191
set_player_info(pduel, 1, cur_replay.params.start_lp, cur_replay.params.start_hand, cur_replay.params.draw_count);

gframe/single_duel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
612612
BufferIO::EncodeUTF8(player_name_buf, player_name_buf_u);
613613
std::snprintf(player_key_buf, sizeof(player_key_buf), "player_name_%d", i);
614614
set_registry_value(pduel, player_key_buf, player_name_buf_u);
615-
std::snprintf(player_key_buf, sizeof(player_key_buf), "player_type_%d", i);
616-
set_registry_value(pduel, player_key_buf, std::to_string(players[i]->type).c_str());
617615
}
616+
set_registry_value(pduel, "player_type_0", swapped ? "1" : "0");
617+
set_registry_value(pduel, "player_type_1", swapped ? "0" : "1");
618618
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
619619
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
620620
preload_script(pduel, "./script/special.lua");

gframe/single_mode.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ int SingleMode::SinglePlayThread() {
5353
set_message_handler(SingleMode::MessageHandler);
5454
pduel = create_duel_v2(duel_seed);
5555
mainGame->InjectEnvToRegistry(pduel);
56+
set_registry_value(pduel, "duel_mode", "puzzle");
57+
set_registry_value(pduel, "start_lp", std::to_string(start_lp).c_str());
58+
set_registry_value(pduel, "start_hand", std::to_string(start_hand).c_str());
59+
set_registry_value(pduel, "draw_count", std::to_string(draw_count).c_str());
60+
set_registry_value(pduel, "player_type_0", swapped ? "1" : "0");
61+
set_registry_value(pduel, "player_type_1", swapped ? "0" : "1");
5662
set_player_info(pduel, 0, start_lp, start_hand, draw_count);
5763
set_player_info(pduel, 1, start_lp, start_hand, draw_count);
5864
preload_script(pduel, "./script/special.lua");

gframe/tag_duel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,14 +583,14 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
583583
wchar_t player_name_buf[40];
584584
char player_name_buf_u[40];
585585
char player_key_buf[23];
586-
for(int i = 0; i < 2; ++i) {
586+
for(int i = 0; i < 4; ++i) {
587587
BufferIO::CopyCharArray(players[i]->name, player_name_buf);
588588
BufferIO::EncodeUTF8(player_name_buf, player_name_buf_u);
589589
std::snprintf(player_key_buf, sizeof(player_key_buf), "player_name_%d", i);
590590
set_registry_value(pduel, player_key_buf, player_name_buf_u);
591-
std::snprintf(player_key_buf, sizeof(player_key_buf), "player_type_%d", i);
592-
set_registry_value(pduel, player_key_buf, std::to_string(players[i]->type).c_str());
593591
}
592+
set_registry_value(pduel, "player_type_0", swapped ? "1" : "0");
593+
set_registry_value(pduel, "player_type_1", swapped ? "0" : "1");
594594
set_player_info(pduel, 0, host_info.start_lp, host_info.start_hand, host_info.draw_count);
595595
set_player_info(pduel, 1, host_info.start_lp, host_info.start_hand, host_info.draw_count);
596596
preload_script(pduel, "./script/special.lua");

system.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use_d3d = 0
44
use_image_scale = 1
55
use_image_scale_multi_thread = 1
66
use_image_load_background_thread = 0
7-
pro_version = 4961
7+
pro_version = 4962
88
freever = 1
99
antialias = 2
1010
errorlog = 3

0 commit comments

Comments
 (0)