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
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
MyCard
ygopro-core
Commits
b96c9081
Commit
b96c9081
authored
Oct 15, 2017
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix attack rollback
parent
db6804c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
20 deletions
+11
-20
field.cpp
field.cpp
+1
-2
field.h
field.h
+1
-1
libduel.cpp
libduel.cpp
+2
-3
processor.cpp
processor.cpp
+7
-14
No files found.
field.cpp
View file @
b96c9081
...
...
@@ -68,8 +68,7 @@ field::field(duel* pduel) {
}
core
.
pre_field
[
0
]
=
0
;
core
.
pre_field
[
1
]
=
0
;
for
(
int32
i
=
0
;
i
<
7
;
++
i
)
core
.
opp_mzone
[
i
]
=
0
;
core
.
opp_mzone
.
clear
();
core
.
summoning_card
=
0
;
core
.
summon_depth
=
0
;
core
.
summon_cancelable
=
FALSE
;
...
...
field.h
View file @
b96c9081
...
...
@@ -243,7 +243,7 @@ struct processor {
ptr
temp_var
[
4
];
uint32
global_flag
;
uint16
pre_field
[
2
];
uint16
opp_mzone
[
7
]
;
std
::
set
<
uint16
>
opp_mzone
;
chain_limit_list
chain_limit
;
chain_limit_list
chain_limit_p
;
uint8
chain_solving
;
...
...
libduel.cpp
View file @
b96c9081
...
...
@@ -1347,12 +1347,11 @@ int32 scriptlib::duel_change_attack_target(lua_State *L) {
||
!
target
&&
!
attacker
->
is_affected_by_effect
(
EFFECT_CANNOT_DIRECT_ATTACK
))
{
pduel
->
game_field
->
core
.
attack_target
=
target
;
pduel
->
game_field
->
core
.
attack_rollback
=
FALSE
;
pduel
->
game_field
->
core
.
opp_mzone
.
clear
();
for
(
uint32
i
=
0
;
i
<
pduel
->
game_field
->
player
[
1
-
turnp
].
list_mzone
.
size
();
++
i
)
{
card
*
pcard
=
pduel
->
game_field
->
player
[
1
-
turnp
].
list_mzone
[
i
];
if
(
pcard
)
pduel
->
game_field
->
core
.
opp_mzone
[
i
]
=
pcard
->
fieldid_r
;
else
pduel
->
game_field
->
core
.
opp_mzone
[
i
]
=
0
;
pduel
->
game_field
->
core
.
opp_mzone
.
insert
(
pcard
->
fieldid_r
);
}
pduel
->
game_field
->
attack_all_target_check
();
if
(
target
)
{
...
...
processor.cpp
View file @
b96c9081
...
...
@@ -3044,12 +3044,11 @@ int32 field::process_battle_command(uint16 step) {
}
else
pduel
->
write_buffer32
(
0
);
core
.
attack_rollback
=
FALSE
;
core
.
opp_mzone
.
clear
();
for
(
uint32
i
=
0
;
i
<
player
[
1
-
infos
.
turn_player
].
list_mzone
.
size
();
++
i
)
{
card
*
pcard
=
player
[
1
-
infos
.
turn_player
].
list_mzone
[
i
];
if
(
pcard
)
core
.
opp_mzone
[
i
]
=
pcard
->
fieldid_r
;
else
core
.
opp_mzone
[
i
]
=
0
;
core
.
opp_mzone
.
insert
(
pcard
->
fieldid_r
);
}
//core.units.begin()->arg1 ---> is rollbacked
if
(
!
core
.
units
.
begin
()
->
arg1
)
{
...
...
@@ -5296,20 +5295,14 @@ int32 field::adjust_step(uint16 step) {
attacker
->
set_status
(
STATUS_ATTACK_CANCELED
,
TRUE
);
if
(
core
.
attack_rollback
)
return
FALSE
;
std
::
set
<
uint16
>
fidset
;
for
(
uint32
i
=
0
;
i
<
player
[
1
-
infos
.
turn_player
].
list_mzone
.
size
();
++
i
)
{
card
*
pcard
=
player
[
1
-
infos
.
turn_player
].
list_mzone
[
i
];
if
(
pcard
)
{
if
(
!
core
.
opp_mzone
[
i
]
||
core
.
opp_mzone
[
i
]
!=
pcard
->
fieldid_r
)
{
core
.
attack_rollback
=
TRUE
;
break
;
}
}
else
{
if
(
core
.
opp_mzone
[
i
])
{
core
.
attack_rollback
=
TRUE
;
break
;
}
}
if
(
pcard
)
fidset
.
insert
(
pcard
->
fieldid_r
);
}
if
(
fidset
!=
core
.
opp_mzone
)
core
.
attack_rollback
=
TRUE
;
return
FALSE
;
}
case
15
:
{
...
...
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