Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
nanahira
ygopro-core
Commits
3a18a582
Commit
3a18a582
authored
Aug 17, 2023
by
salix5
Committed by
GitHub
Aug 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix field::draw() (#503)
Now count is int32.
parent
dc56e623
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
field.h
field.h
+2
-2
libduel.cpp
libduel.cpp
+3
-1
operations.cpp
operations.cpp
+4
-4
processor.cpp
processor.cpp
+2
-2
No files found.
field.h
View file @
3a18a582
...
...
@@ -575,7 +575,7 @@ public:
void
swap_control
(
effect
*
reason_effect
,
uint32
reason_player
,
card_set
*
targets1
,
card_set
*
targets2
,
uint32
reset_phase
,
uint32
reset_count
);
void
swap_control
(
effect
*
reason_effect
,
uint32
reason_player
,
card
*
pcard1
,
card
*
pcard2
,
uint32
reset_phase
,
uint32
reset_count
);
void
equip
(
uint32
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
);
void
draw
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
u
int32
count
);
void
draw
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
int32
count
);
void
damage
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
card
*
reason_card
,
uint32
playerid
,
int32
amount
,
uint32
is_step
=
FALSE
);
void
recover
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
int32
amount
,
uint32
is_step
=
FALSE
);
void
summon
(
uint32
sumplayer
,
card
*
target
,
effect
*
proc
,
uint32
ignore_count
,
uint32
min_tribute
,
uint32
zone
=
0x1f
);
...
...
@@ -603,7 +603,7 @@ public:
int32
self_destroy
(
uint16
step
,
card
*
ucard
,
int32
p
);
int32
trap_monster_adjust
(
uint16
step
);
int32
equip
(
uint16
step
,
uint8
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
);
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
u
int32
count
);
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
count
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
reason_card
,
uint8
playerid
,
int32
amount
,
uint32
is_step
);
int32
recover
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
amount
,
uint32
is_step
);
int32
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
...
...
libduel.cpp
View file @
3a18a582
...
...
@@ -1247,7 +1247,9 @@ int32 scriptlib::duel_draw(lua_State *L) {
uint32
playerid
=
(
uint32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
uint32
count
=
(
uint32
)
lua_tointeger
(
L
,
2
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
2
);
if
(
count
<
0
)
count
=
0
;
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
draw
(
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
playerid
,
count
);
...
...
operations.cpp
View file @
3a18a582
...
...
@@ -139,8 +139,8 @@ void field::swap_control(effect* reason_effect, uint32 reason_player, card* pcar
void
field
::
equip
(
uint32
equip_player
,
card
*
equip_card
,
card
*
target
,
uint32
up
,
uint32
is_step
)
{
add_process
(
PROCESSOR_EQUIP
,
0
,
NULL
,
(
group
*
)
target
,
0
,
equip_player
+
(
up
<<
16
)
+
(
is_step
<<
24
),
0
,
0
,
equip_card
);
}
void
field
::
draw
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
u
int32
count
)
{
add_process
(
PROCESSOR_DRAW
,
0
,
reason_effect
,
0
,
reason
,
(
reason_player
<<
28
)
+
(
playerid
<<
24
)
+
(
count
&
0xffffff
)
);
void
field
::
draw
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
int32
count
)
{
add_process
(
PROCESSOR_DRAW
,
0
,
reason_effect
,
0
,
reason
,
(
reason_player
<<
4
)
+
(
playerid
),
count
);
}
void
field
::
damage
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
card
*
reason_card
,
uint32
playerid
,
int32
amount
,
uint32
is_step
)
{
uint32
arg2
=
(
is_step
<<
4
)
+
(
reason_player
<<
2
)
+
(
playerid
);
...
...
@@ -338,7 +338,7 @@ void field::operation_replace(int32 type, int32 step, group* targets) {
void
field
::
select_tribute_cards
(
card
*
target
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint8
toplayer
,
uint32
zone
)
{
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
(
group
*
)
target
,
playerid
+
((
uint32
)
cancelable
<<
16
),
min
+
(
max
<<
16
),
toplayer
,
zone
);
}
int32
field
::
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
u
int32
count
)
{
int32
field
::
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
int32
count
)
{
switch
(
step
)
{
case
0
:
{
card_vector
cv
;
...
...
@@ -349,7 +349,7 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
return
TRUE
;
}
core
.
overdraw
[
playerid
]
=
FALSE
;
for
(
u
int32
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
count
;
++
i
)
{
if
(
player
[
playerid
].
list_main
.
size
()
==
0
)
{
core
.
overdraw
[
playerid
]
=
TRUE
;
break
;
...
...
processor.cpp
View file @
3a18a582
...
...
@@ -420,7 +420,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
}
case
PROCESSOR_DRAW
:
{
if
(
draw
(
it
->
step
,
it
->
peffect
,
it
->
arg1
,
(
it
->
arg2
>>
28
)
&
0xf
,
(
it
->
arg2
>>
24
)
&
0xf
,
it
->
arg2
&
0xffffff
))
if
(
draw
(
it
->
step
,
it
->
peffect
,
it
->
arg1
,
(
it
->
arg2
>>
4
)
&
0xf
,
(
it
->
arg2
)
&
0xf
,
it
->
arg3
))
core
.
units
.
pop_front
();
else
it
->
step
++
;
...
...
@@ -3755,7 +3755,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
if
((
core
.
duel_rule
<=
2
)
||
(
infos
.
turn_id
>
1
))
{
int32
count
=
get_draw_count
(
infos
.
turn_player
);
if
(
count
>
0
)
{
draw
(
0
,
REASON_RULE
,
turn_player
,
turn_player
,
count
);
draw
(
nullptr
,
REASON_RULE
,
turn_player
,
turn_player
,
count
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
0
);
}
}
...
...
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