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
6fed992e
Commit
6fed992e
authored
Dec 07, 2023
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update std container erase
parent
01651763
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
card.cpp
card.cpp
+4
-3
operations.cpp
operations.cpp
+8
-3
No files found.
card.cpp
View file @
6fed992e
...
...
@@ -1950,9 +1950,10 @@ void card::reset(uint32 id, uint32 reset_type) {
return
;
if
(
reset_type
==
RESET_EVENT
)
{
for
(
auto
rit
=
relations
.
begin
();
rit
!=
relations
.
end
();)
{
auto
rrm
=
rit
++
;
if
(
rrm
->
second
&
0xffff0000
&
id
)
relations
.
erase
(
rrm
);
if
(
rit
->
second
&
0xffff0000
&
id
)
rit
=
relations
.
erase
(
rit
);
else
++
rit
;
}
if
(
id
&
(
RESET_TODECK
|
RESET_TOHAND
|
RESET_TOGRAVE
|
RESET_REMOVE
|
RESET_TEMP_REMOVE
|
RESET_OVERLAY
|
RESET_MSCHANGE
))
...
...
operations.cpp
View file @
6fed992e
...
...
@@ -3404,10 +3404,10 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
card_set
indestructable_set
;
std
::
set
<
effect
*>
indestructable_effect_set
;
for
(
auto
cit
=
targets
->
container
.
begin
();
cit
!=
targets
->
container
.
end
();)
{
auto
rm
=
cit
++
;
card
*
pcard
=
*
rm
;
card
*
pcard
=
*
cit
;
if
(
!
pcard
->
is_destructable
())
{
indestructable_set
.
insert
(
pcard
);
++
cit
;
continue
;
}
if
(
!
(
pcard
->
current
.
reason
&
(
REASON_RULE
|
REASON_COST
)))
{
...
...
@@ -3423,6 +3423,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
is_destructable
=
false
;
if
(
!
is_destructable
)
{
indestructable_set
.
insert
(
pcard
);
++
cit
;
continue
;
}
}
...
...
@@ -3443,6 +3444,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
}
if
(
!
is_destructable
)
{
indestructable_set
.
insert
(
pcard
);
++
cit
;
continue
;
}
}
...
...
@@ -3478,6 +3480,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
}
if
(
!
is_destructable
)
{
core
.
indestructable_count_set
.
insert
(
pcard
);
++
cit
;
continue
;
}
}
...
...
@@ -3499,9 +3502,11 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
current
.
reason_effect
=
pcard
->
temp
.
reason_effect
;
pcard
->
current
.
reason_player
=
pcard
->
temp
.
reason_player
;
core
.
destroy_canceled
.
insert
(
pcard
);
targets
->
container
.
erase
(
pcard
);
cit
=
targets
->
container
.
erase
(
cit
);
continue
;
}
}
++
cit
;
}
for
(
auto
&
pcard
:
indestructable_set
)
{
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
...
...
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