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
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
Commits
56a1adc3
Commit
56a1adc3
authored
May 19, 2014
by
Damien Lawford
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more c++ friendly
allows compiling on older versions of c++
parent
78dea945
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
ocgcore/field.cpp
ocgcore/field.cpp
+15
-15
ocgcore/operations.cpp
ocgcore/operations.cpp
+8
-8
No files found.
ocgcore/field.cpp
View file @
56a1adc3
...
...
@@ -1293,20 +1293,20 @@ void field::get_xyz_material(card* scard, int32 findex, int32 maxc) {
cv
.
push_back
(
pcard
);
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
for
(
auto
pcard
:
cv
)
{
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_XMAT_COUNT_LIMIT
);
for
(
auto
pcard
=
cv
.
begin
();
pcard
!=
cv
.
end
();
++
pcard
)
{
effect
*
peffect
=
(
*
pcard
)
->
is_affected_by_effect
(
EFFECT_XMAT_COUNT_LIMIT
);
if
(
peffect
)
{
int32
v
=
peffect
->
get_value
();
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
v
,
pcard
));
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
v
,
*
pcard
));
}
else
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
pcard
));
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
*
pcard
));
}
auto
iter
=
core
.
xmaterial_lst
.
begin
();
while
((
iter
!=
core
.
xmaterial_lst
.
end
())
&&
((
iter
->
first
>
core
.
xmaterial_lst
.
size
())
||
(
iter
->
first
>
maxc
)))
core
.
xmaterial_lst
.
erase
(
iter
++
);
}
else
{
for
(
auto
pcard
:
cv
)
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
pcard
));
for
(
auto
pcard
=
cv
.
begin
();
pcard
!=
cv
.
end
();
++
pcard
)
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
*
pcard
));
}
}
void
field
::
get_overlay_group
(
uint8
self
,
uint8
s
,
uint8
o
,
card_set
*
pset
)
{
...
...
@@ -1680,25 +1680,25 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 min, int32 max,
if
(
mg
)
{
card_vector
cv
;
core
.
xmaterial_lst
.
clear
();
for
(
auto
pcard
:
mg
->
container
)
{
if
(
pduel
->
lua
->
check_matching
(
pcard
,
findex
,
0
))
cv
.
push_back
(
pcard
);
for
(
auto
pcard
=
mg
->
container
.
begin
();
pcard
!=
mg
->
container
.
end
();
++
pcard
)
{
if
(
pduel
->
lua
->
check_matching
(
*
pcard
,
findex
,
0
))
cv
.
push_back
(
*
pcard
);
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
for
(
auto
pcard
:
cv
)
{
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_XMAT_COUNT_LIMIT
);
for
(
auto
pcard
=
cv
.
begin
();
pcard
!=
cv
.
end
();
++
pcard
)
{
effect
*
peffect
=
(
*
pcard
)
->
is_affected_by_effect
(
EFFECT_XMAT_COUNT_LIMIT
);
if
(
peffect
)
{
int32
v
=
peffect
->
get_value
();
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
v
,
pcard
));
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
v
,
*
pcard
));
}
else
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
pcard
));
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
*
pcard
));
}
auto
iter
=
core
.
xmaterial_lst
.
begin
();
while
((
iter
!=
core
.
xmaterial_lst
.
end
())
&&
((
iter
->
first
>
core
.
xmaterial_lst
.
size
())
||
(
iter
->
first
>
max
)))
core
.
xmaterial_lst
.
erase
(
iter
++
);
}
else
{
for
(
auto
pcard
:
cv
)
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
pcard
));
for
(
auto
pcard
=
cv
.
begin
();
pcard
!=
cv
.
end
();
++
pcard
)
core
.
xmaterial_lst
.
insert
(
std
::
make_pair
(
0
,
*
pcard
));
}
}
else
{
pduel
->
game_field
->
get_xyz_material
(
scard
,
findex
,
max
);
...
...
ocgcore/operations.cpp
View file @
56a1adc3
...
...
@@ -3986,8 +3986,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, card* scard, int32
maxv
=
core
.
xmaterial_lst
.
begin
()
->
first
;
if
(
min
>=
maxv
)
{
core
.
select_cards
.
clear
();
for
(
auto
iter
:
core
.
xmaterial_lst
)
core
.
select_cards
.
push_back
(
iter
.
second
);
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
++
iter
)
core
.
select_cards
.
push_back
(
iter
->
second
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
...
...
@@ -4009,8 +4009,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, card* scard, int32
case
2
:
{
core
.
operated_set
.
clear
();
core
.
select_cards
.
clear
();
for
(
auto
iter
:
core
.
xmaterial_lst
)
core
.
select_cards
.
push_back
(
iter
.
second
);
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
++
iter
)
core
.
select_cards
.
push_back
(
iter
->
second
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
...
...
@@ -4055,8 +4055,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, card* scard, int32
return
TRUE
;
}
core
.
select_cards
.
clear
();
for
(
auto
iter
:
core
.
xmaterial_lst
)
core
.
select_cards
.
push_back
(
iter
.
second
);
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
iter
++
)
core
.
select_cards
.
push_back
(
iter
->
second
);
int
maxv
=
core
.
xmaterial_lst
.
begin
()
->
first
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
...
...
@@ -4072,8 +4072,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, card* scard, int32
}
case
5
:
{
group
*
pgroup
=
pduel
->
new_group
();
for
(
auto
pcard
:
core
.
operated_set
)
pgroup
->
container
.
insert
(
pcard
);
for
(
auto
pcard
=
core
.
operated_set
.
begin
();
pcard
!=
core
.
operated_set
.
end
();
++
pcard
)
pgroup
->
container
.
insert
(
*
pcard
);
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
...
...
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