Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
3d406169
Commit
3d406169
authored
Jan 14, 2013
by
Fluorohydride
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #388 from VanillaSalt/patch48
fix
parents
080bd0b5
cf3e824f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
ocgcore/card.cpp
ocgcore/card.cpp
+8
-6
ocgcore/card.h
ocgcore/card.h
+1
-1
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+1
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+2
-2
ocgcore/libgroup.cpp
ocgcore/libgroup.cpp
+2
-2
No files found.
ocgcore/card.cpp
View file @
3d406169
...
...
@@ -1012,9 +1012,11 @@ void card::create_relation(card* target, uint32 reset) {
relations
[
target
]
=
reset
;
}
void
card
::
create_relation
(
effect
*
peffect
)
{
if
(
relate_effect
.
find
(
peffect
)
!=
relate_effect
.
end
())
return
;
relate_effect
.
insert
(
peffect
);
auto
it
=
relate_effect
.
find
(
peffect
);
if
(
it
!=
relate_effect
.
end
())
++
it
->
second
;
else
relate_effect
[
peffect
]
=
1
;
}
int32
card
::
is_has_relation
(
card
*
target
)
{
if
(
relations
.
find
(
target
)
!=
relations
.
end
())
...
...
@@ -1032,9 +1034,9 @@ void card::release_relation(card* target) {
relations
.
erase
(
target
);
}
void
card
::
release_relation
(
effect
*
peffect
)
{
if
(
relate_effect
.
find
(
peffect
)
==
relate_effect
.
end
())
return
;
relate_effect
.
erase
(
peffec
t
);
auto
it
=
relate_effect
.
find
(
peffect
);
if
(
it
!=
relate_effect
.
end
()
&&
--
it
->
second
==
0
)
relate_effect
.
erase
(
i
t
);
}
int32
card
::
leave_field_redirect
(
uint32
reason
)
{
effect_set
es
;
...
...
ocgcore/card.h
View file @
3d406169
...
...
@@ -73,7 +73,7 @@ public:
typedef
std
::
multimap
<
uint32
,
effect
*>
effect_container
;
typedef
std
::
set
<
card
*
,
card_sort
>
card_set
;
typedef
std
::
map
<
effect
*
,
effect_container
::
iterator
>
effect_indexer
;
typedef
std
::
set
<
effect
*
>
effect_relation
;
typedef
std
::
map
<
effect
*
,
uint32
>
effect_relation
;
typedef
std
::
map
<
card
*
,
uint32
>
relation_map
;
typedef
std
::
map
<
uint16
,
uint16
>
counter_map
;
typedef
std
::
map
<
uint16
,
card
*>
attacker_map
;
...
...
ocgcore/libcard.cpp
View file @
3d406169
...
...
@@ -912,7 +912,7 @@ int32 scriptlib::card_release_effect_relation(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_EFFECT
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
2
);
pcard
->
rel
ate_effect
.
erase
(
peffect
);
pcard
->
rel
ease_relation
(
peffect
);
return
0
;
}
int32
scriptlib
::
card_clear_effect_relation
(
lua_State
*
L
)
{
...
...
ocgcore/libduel.cpp
View file @
3d406169
...
...
@@ -2855,10 +2855,10 @@ int32 scriptlib::duel_check_chain_uniqueness(lua_State *L) {
lua_pushboolean
(
L
,
1
);
return
1
;
}
card
::
effect_relation
er
;
std
::
set
<
uint32
>
er
;
field
::
chain_array
::
iterator
cait
;
for
(
cait
=
pduel
->
game_field
->
core
.
current_chain
.
begin
();
cait
!=
pduel
->
game_field
->
core
.
current_chain
.
end
();
++
cait
)
er
.
insert
(
(
effect
*
)(
size_t
)(
cait
->
triggering_effect
->
handler
->
get_code
()
));
er
.
insert
(
cait
->
triggering_effect
->
handler
->
get_code
(
));
if
(
er
.
size
()
==
pduel
->
game_field
->
core
.
current_chain
.
size
())
lua_pushboolean
(
L
,
1
);
else
...
...
ocgcore/libgroup.cpp
View file @
3d406169
...
...
@@ -453,10 +453,10 @@ int32 scriptlib::group_get_class_count(lua_State *L) {
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
pgroup
->
pduel
;
int32
extraargs
=
lua_gettop
(
L
)
-
2
;
card
::
effect_relation
er
;
std
::
set
<
uint32
>
er
;
field
::
card_set
::
iterator
cit
=
pgroup
->
container
.
begin
();
for
(;
cit
!=
pgroup
->
container
.
end
();
++
cit
)
{
er
.
insert
(
(
effect
*
)(
size_t
)
pduel
->
lua
->
get_operation_value
(
*
cit
,
2
,
extraargs
));
er
.
insert
(
pduel
->
lua
->
get_operation_value
(
*
cit
,
2
,
extraargs
));
}
lua_pushinteger
(
L
,
er
.
size
());
return
1
;
...
...
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