Commit 57557b86 authored by Chen Bill's avatar Chen Bill

update Group.IsExists

parent 7a6a7819
...@@ -393,6 +393,10 @@ int32 scriptlib::group_is_exists(lua_State *L) { ...@@ -393,6 +393,10 @@ int32 scriptlib::group_is_exists(lua_State *L) {
uint32 extraargs = lua_gettop(L) - 4; uint32 extraargs = lua_gettop(L) - 4;
uint32 fcount = 0; uint32 fcount = 0;
uint32 result = FALSE; uint32 result = FALSE;
if (count > pgroup->container.size()) {
lua_pushboolean(L, 0);
return 1;
}
for (auto& pcard : cset) { for (auto& pcard : cset) {
if(pduel->lua->check_matching(pcard, 2, extraargs)) { if(pduel->lua->check_matching(pcard, 2, extraargs)) {
++fcount; ++fcount;
...@@ -721,11 +725,12 @@ int32 scriptlib::group_search_card(lua_State *L) { ...@@ -721,11 +725,12 @@ int32 scriptlib::group_search_card(lua_State *L) {
group* pgroup = *(group**) lua_touserdata(L, 1); group* pgroup = *(group**) lua_touserdata(L, 1);
duel* pduel = pgroup->pduel; duel* pduel = pgroup->pduel;
uint32 extraargs = lua_gettop(L) - 2; uint32 extraargs = lua_gettop(L) - 2;
for(auto& pcard : pgroup->container) for (auto& pcard : pgroup->container) {
if(pduel->lua->check_matching(pcard, 2, extraargs)) { if (pduel->lua->check_matching(pcard, 2, extraargs)) {
interpreter::card2value(L, pcard); interpreter::card2value(L, pcard);
return 1; return 1;
} }
}
return 0; return 0;
} }
int32 scriptlib::group_get_bin_class_count(lua_State *L) { int32 scriptlib::group_get_bin_class_count(lua_State *L) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment