Commit d2193e30 authored by VanillaSalt's avatar VanillaSalt

update

parent fb6f13bf
...@@ -232,7 +232,7 @@ static const struct luaL_Reg cardlib[] = { ...@@ -232,7 +232,7 @@ static const struct luaL_Reg cardlib[] = {
{ "ResetNegateEffect", scriptlib::card_reset_negate_effect }, { "ResetNegateEffect", scriptlib::card_reset_negate_effect },
{ "AssumeProperty", scriptlib::card_assume_prop }, { "AssumeProperty", scriptlib::card_assume_prop },
{ "SetSPSummonOnce", scriptlib::card_set_spsummon_once }, { "SetSPSummonOnce", scriptlib::card_set_spsummon_once },
{ "CheckMZoneFromEX", scriptlib::card_check_mzone_from_ex }, { "CheckMZoneFromEx", scriptlib::card_check_mzone_from_ex },
{ NULL, NULL } { NULL, NULL }
}; };
......
...@@ -2453,17 +2453,17 @@ int32 scriptlib::card_set_spsummon_once(lua_State *L) { ...@@ -2453,17 +2453,17 @@ int32 scriptlib::card_set_spsummon_once(lua_State *L) {
return 0; return 0;
} }
int32 scriptlib::card_check_mzone_from_ex(lua_State *L) { int32 scriptlib::card_check_mzone_from_ex(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
card::card_set linked_cards; int32 playerid = lua_tointeger(L, 2);
for(int32 playerid = 0; playerid < 2; ++playerid) { duel* pduel = pcard->pduel;
uint32 linked_zone = pcard->pduel->game_field->core.duel_rule >= 4 ? pcard->pduel->game_field->get_linked_zone(playerid) | (1u << 5) | (1u << 6) : 0x1f; field::card_set linked_cards;
pcard->pduel->game_field->get_cards_in_zone(&linked_cards, linked_zone, playerid); uint32 linked_zone = pduel->game_field->core.duel_rule >= 4 ? pduel->game_field->get_linked_zone(playerid) | (1u << 5) | (1u << 6) : 0x1f;
if(linked_cards.find(pcard) != linked_cards.end()) pduel->game_field->get_cards_in_zone(&linked_cards, linked_zone, playerid);
lua_pushboolean(L, 1); if(linked_cards.find(pcard) != linked_cards.end())
else lua_pushboolean(L, 1);
lua_pushboolean(L, 0); else
} lua_pushboolean(L, 0);
return 1; 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