Commit c0e402bb authored by salix5's avatar salix5

minor fix

parent a462486b
...@@ -2411,7 +2411,7 @@ int32 scriptlib::card_is_releasable(lua_State *L) { ...@@ -2411,7 +2411,7 @@ int32 scriptlib::card_is_releasable(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
uint32 p = pcard->pduel->game_field->core.reason_player; uint32 p = pcard->pduel->game_field->core.reason_player;
uint32 reason = 0; uint32 reason = 0;
if (!lua_isnil(L, 2)) if (lua_gettop(L) >= 2)
reason = (uint32)lua_tointeger(L, 2); reason = (uint32)lua_tointeger(L, 2);
if(pcard->is_releasable_by_nonsummon(p, reason)) if(pcard->is_releasable_by_nonsummon(p, reason))
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
......
...@@ -4325,7 +4325,7 @@ int32 scriptlib::duel_is_player_can_release(lua_State * L) { ...@@ -4325,7 +4325,7 @@ int32 scriptlib::duel_is_player_can_release(lua_State * L) {
check_param(L, PARAM_TYPE_CARD, 2); check_param(L, PARAM_TYPE_CARD, 2);
card* pcard = *(card**) lua_touserdata(L, 2); card* pcard = *(card**) lua_touserdata(L, 2);
uint32 reason = 0; uint32 reason = 0;
if (!lua_isnil(L, 3)) if (lua_gettop(L) >= 3)
reason = (uint32)lua_tointeger(L, 3); reason = (uint32)lua_tointeger(L, 3);
lua_pushboolean(L, pduel->game_field->is_player_can_release(playerid, pcard, reason)); lua_pushboolean(L, pduel->game_field->is_player_can_release(playerid, pcard, reason));
} }
......
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