Commit 95cb59ee authored by Momobako's avatar Momobako

updc

parent 6c159212
...@@ -308,7 +308,14 @@ int32 scriptlib::card_get_linked_zone(lua_State *L) { ...@@ -308,7 +308,14 @@ int32 scriptlib::card_get_linked_zone(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
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);
lua_pushinteger(L, pcard->get_linked_zone()); uint32 zone = pcard->get_linked_zone();
int32 cp = pcard->current.controler;
if(lua_gettop(L) >= 2 && !lua_isnil(L, 2))
cp = lua_tointeger(L, 2);
if(cp == 1 - pcard->current.controler)
lua_pushinteger(L, (((zone & 0xffff) << 16) | (zone >> 16)));
else
lua_pushinteger(L, zone);
return 1; return 1;
} }
int32 scriptlib::card_get_mutual_linked_group(lua_State *L) { int32 scriptlib::card_get_mutual_linked_group(lua_State *L) {
...@@ -334,7 +341,14 @@ int32 scriptlib::card_get_mutual_linked_zone(lua_State *L) { ...@@ -334,7 +341,14 @@ int32 scriptlib::card_get_mutual_linked_zone(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
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);
lua_pushinteger(L, pcard->get_mutual_linked_zone()); uint32 zone = pcard->get_mutual_linked_zone();
int32 cp = pcard->current.controler;
if(lua_gettop(L) >= 2 && !lua_isnil(L, 2))
cp = lua_tointeger(L, 2);
if(cp == 1 - pcard->current.controler)
lua_pushinteger(L, (((zone & 0xffff) << 16) | (zone >> 16)));
else
lua_pushinteger(L, zone);
return 1; return 1;
} }
int32 scriptlib::card_is_link_state(lua_State *L) { int32 scriptlib::card_is_link_state(lua_State *L) {
...@@ -382,11 +396,18 @@ int32 scriptlib::card_get_column_zone(lua_State *L) { ...@@ -382,11 +396,18 @@ int32 scriptlib::card_get_column_zone(lua_State *L) {
int32 loc = lua_tointeger(L, 2); int32 loc = lua_tointeger(L, 2);
int32 left = 0; int32 left = 0;
int32 right = 0; int32 right = 0;
int32 cp = pcard->current.controler;
if(lua_gettop(L) >= 3) if(lua_gettop(L) >= 3)
left = lua_tointeger(L, 3); left = lua_tointeger(L, 3);
if(lua_gettop(L) >= 4) if(lua_gettop(L) >= 4)
right = lua_tointeger(L, 4); right = lua_tointeger(L, 4);
lua_pushinteger(L, pcard->get_column_zone(loc, left, right)); if(lua_gettop(L) >= 5 && !lua_isnil(L, 5))
cp = lua_tointeger(L, 5);
uint32 zone = pcard->get_column_zone(loc, left, right);
if(cp == 1 - pcard->current.controler)
lua_pushinteger(L, (((zone & 0xffff) << 16) | (zone >> 16)));
else
lua_pushinteger(L, zone);
return 1; return 1;
} }
int32 scriptlib::card_is_all_column(lua_State *L) { int32 scriptlib::card_is_all_column(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