Commit eaf25b84 authored by mercury233's avatar mercury233 Committed by GitHub

update Duel.GetSynchroMaterial (#569)

parent 2c4f4742
......@@ -3172,9 +3172,19 @@ int32 scriptlib::duel_get_synchro_material(lua_State *L) {
int32 playerid = (int32)lua_tointeger(L, 1);
if(playerid != 0 && playerid != 1)
return 0;
uint32 facedown = FALSE;
if (lua_gettop(L) >= 2)
facedown = lua_toboolean(L, 2);
duel* pduel = interpreter::get_duel_info(L);
group::card_set mats;
pduel->game_field->get_synchro_material(playerid, &mats);
group* pgroup = pduel->new_group();
pduel->game_field->get_synchro_material(playerid, &pgroup->container);
for (auto cit = mats.begin(); cit != mats.end(); ++cit) {
card* pcard = *cit;
if (pcard->current.location == LOCATION_MZONE && !pcard->is_position(POS_FACEUP) && !facedown)
continue;
pgroup->container.insert(*cit);
}
interpreter::group2value(L, pgroup);
return 1;
}
......
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