Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YGOPRO-520DIY
ygopro
Commits
d908fd9a
Commit
d908fd9a
authored
May 04, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ReplayMode::StartDuel
parent
456abfca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
69 deletions
+42
-69
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+42
-69
No files found.
gframe/replay_mode.cpp
View file @
d908fd9a
...
...
@@ -159,88 +159,61 @@ bool ReplayMode::StartDuel() {
unsigned
int
seed
=
rh
.
seed
;
std
::
mt19937
rnd
(
seed
);
if
(
mainGame
->
dInfo
.
isTag
)
{
cur_replay
.
ReadName
(
mainGame
->
dInfo
.
hostname
);
cur_replay
.
ReadName
(
mainGame
->
dInfo
.
hostname_tag
);
cur_replay
.
ReadName
(
mainGame
->
dInfo
.
clientname_tag
);
cur_replay
.
ReadName
(
mainGame
->
dInfo
.
clientname
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
0
].
c_str
(),
mainGame
->
dInfo
.
hostname
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
1
].
c_str
(),
mainGame
->
dInfo
.
hostname_tag
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
2
].
c_str
(),
mainGame
->
dInfo
.
clientname_tag
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
3
].
c_str
(),
mainGame
->
dInfo
.
clientname
);
}
else
{
cur_replay
.
ReadName
(
mainGame
->
dInfo
.
hostname
);
cur_replay
.
ReadName
(
mainGame
->
dInfo
.
clientname
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
0
].
c_str
(),
mainGame
->
dInfo
.
hostname
);
BufferIO
::
CopyWideString
(
cur_replay
.
players
[
1
].
c_str
(),
mainGame
->
dInfo
.
clientname
);
}
pduel
=
create_duel
(
rnd
());
int
start_lp
=
cur_replay
.
ReadInt32
();
int
start_hand
=
cur_replay
.
ReadInt32
();
int
draw_count
=
cur_replay
.
ReadInt32
();
int
opt
=
cur_replay
.
ReadInt32
();
int
duel_rule
=
opt
>>
16
;
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
);
mainGame
->
dInfo
.
lp
[
0
]
=
start_lp
;
mainGame
->
dInfo
.
lp
[
1
]
=
start_lp
;
mainGame
->
dInfo
.
start_lp
=
start_lp
;
mainGame
->
dInfo
.
duel_rule
=
cur_replay
.
params
.
duel_flag
>>
16
;
set_player_info
(
pduel
,
0
,
cur_replay
.
params
.
start_lp
,
cur_replay
.
params
.
start_hand
,
cur_replay
.
params
.
draw_count
);
set_player_info
(
pduel
,
1
,
cur_replay
.
params
.
start_lp
,
cur_replay
.
params
.
start_hand
,
cur_replay
.
params
.
draw_count
);
mainGame
->
dInfo
.
lp
[
0
]
=
cur_replay
.
params
.
start_lp
;
mainGame
->
dInfo
.
lp
[
1
]
=
cur_replay
.
params
.
start_lp
;
mainGame
->
dInfo
.
start_lp
=
cur_replay
.
params
.
start_lp
;
myswprintf
(
mainGame
->
dInfo
.
strLP
[
0
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
0
]);
myswprintf
(
mainGame
->
dInfo
.
strLP
[
1
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
1
]);
mainGame
->
dInfo
.
turn
=
0
;
if
(
!
mainGame
->
dInfo
.
isSingleMode
)
{
if
(
!
(
opt
&
DUEL_TAG_MODE
))
{
int
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
int
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
0
),
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
main
,
extra
);
}
else
{
int
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
int
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
0
),
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
LOCATION_DECK
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
0
,
LOCATION_EXTRA
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
main
,
extra
);
main
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
main
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
LOCATION_DECK
);
extra
=
cur_replay
.
ReadInt32
();
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
new_tag_card
(
pduel
,
cur_replay
.
ReadInt32
(),
1
,
LOCATION_EXTRA
);
if
(
!
(
rh
.
flag
&
REPLAY_SINGLE_MODE
))
{
if
(
!
(
rh
.
flag
&
REPLAY_TAG
))
{
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
for
(
const
auto
&
code
:
cur_replay
.
decks
[
i
].
main
)
new_card
(
pduel
,
code
,
i
,
i
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
for
(
const
auto
&
code
:
cur_replay
.
decks
[
i
].
extra
)
new_card
(
pduel
,
code
,
i
,
i
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
i
),
cur_replay
.
decks
[
i
].
main
.
size
(),
cur_replay
.
decks
[
i
].
extra
.
size
());
}
}
else
{
char
filename
[
256
];
auto
slen
=
cur_replay
.
Read
<
uint16_t
>
();
if
(
slen
>
sizeof
(
filename
)
-
1
)
{
return
false
;
for
(
const
auto
&
code
:
cur_replay
.
decks
[
0
].
main
)
new_card
(
pduel
,
code
,
0
,
0
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
for
(
const
auto
&
code
:
cur_replay
.
decks
[
0
].
extra
)
new_card
(
pduel
,
code
,
0
,
0
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
0
),
cur_replay
.
decks
[
0
].
main
.
size
(),
cur_replay
.
decks
[
0
].
extra
.
size
());
for
(
const
auto
&
code
:
cur_replay
.
decks
[
1
].
main
)
new_tag_card
(
pduel
,
code
,
0
,
LOCATION_DECK
);
for
(
const
auto
&
code
:
cur_replay
.
decks
[
1
].
extra
)
new_tag_card
(
pduel
,
code
,
0
,
LOCATION_EXTRA
);
for
(
const
auto
&
code
:
cur_replay
.
decks
[
2
].
main
)
new_card
(
pduel
,
code
,
1
,
1
,
LOCATION_DECK
,
0
,
POS_FACEDOWN_DEFENSE
);
for
(
const
auto
&
code
:
cur_replay
.
decks
[
2
].
extra
)
new_card
(
pduel
,
code
,
1
,
1
,
LOCATION_EXTRA
,
0
,
POS_FACEDOWN_DEFENSE
);
mainGame
->
dField
.
Initial
(
mainGame
->
LocalPlayer
(
1
),
cur_replay
.
decks
[
2
].
main
.
size
(),
cur_replay
.
decks
[
2
].
extra
.
size
());
for
(
const
auto
&
code
:
cur_replay
.
decks
[
3
].
main
)
new_tag_card
(
pduel
,
code
,
1
,
LOCATION_DECK
);
for
(
const
auto
&
code
:
cur_replay
.
decks
[
3
].
extra
)
new_tag_card
(
pduel
,
code
,
1
,
LOCATION_EXTRA
);
}
cur_replay
.
ReadData
(
filename
,
slen
);
filename
[
slen
]
=
0
;
if
(
!
preload_script
(
pduel
,
filename
))
{
}
else
{
if
(
!
preload_script
(
pduel
,
cur_replay
.
script_name
.
c_str
()))
{
return
false
;
}
}
if
(
!
(
rh
.
flag
&
REPLAY_UNIFORM
))
opt
|=
DUEL_OLD_REPLAY
;
start_duel
(
pduel
,
opt
);
cur_replay
.
params
.
duel_flag
|=
DUEL_OLD_REPLAY
;
start_duel
(
pduel
,
cur_replay
.
params
.
duel_flag
);
return
true
;
}
void
ReplayMode
::
EndDuel
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment