Commit 46864da1 authored by salix5's avatar salix5

update Duel.GetReleaseGroup, GetReleaseGroupCount

add 3rd param (optional): reason
parent c0e402bb
...@@ -2621,9 +2621,12 @@ int32 scriptlib::duel_get_release_group(lua_State *L) { ...@@ -2621,9 +2621,12 @@ int32 scriptlib::duel_get_release_group(lua_State *L) {
uint32 hand = FALSE; uint32 hand = FALSE;
if(lua_gettop(L) > 1) if(lua_gettop(L) > 1)
hand = lua_toboolean(L, 2); hand = lua_toboolean(L, 2);
uint32 reason = 0;
if (lua_gettop(L) >= 3)
reason = (uint32)lua_tointeger(L, 3);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
group* pgroup = pduel->new_group(); group* pgroup = pduel->new_group();
pduel->game_field->get_release_list(playerid, &pgroup->container, &pgroup->container, &pgroup->container, FALSE, hand, 0, 0, 0, 0); pduel->game_field->get_release_list(playerid, &pgroup->container, &pgroup->container, &pgroup->container, FALSE, hand, 0, 0, nullptr, nullptr, reason);
interpreter::group2value(L, pgroup); interpreter::group2value(L, pgroup);
return 1; return 1;
} }
...@@ -2640,8 +2643,11 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) { ...@@ -2640,8 +2643,11 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) {
uint32 hand = FALSE; uint32 hand = FALSE;
if(lua_gettop(L) > 1) if(lua_gettop(L) > 1)
hand = lua_toboolean(L, 2); hand = lua_toboolean(L, 2);
uint32 reason = 0;
if (lua_gettop(L) >= 3)
reason = (uint32)lua_tointeger(L, 3);
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
lua_pushinteger(L, pduel->game_field->get_release_list(playerid, 0, 0, 0, FALSE, hand, 0, 0, 0, 0)); lua_pushinteger(L, pduel->game_field->get_release_list(playerid, 0, 0, 0, FALSE, hand, 0, 0, nullptr, nullptr, reason));
return 1; return 1;
} }
int32 scriptlib::duel_check_release_group(lua_State *L) { int32 scriptlib::duel_check_release_group(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