Commit ee002073 authored by Chen Bill's avatar Chen Bill

update Duel.SendtoHand

see #499
parent 50309aa0
...@@ -613,10 +613,13 @@ int32 scriptlib::duel_sendto_hand(lua_State *L) { ...@@ -613,10 +613,13 @@ int32 scriptlib::duel_sendto_hand(lua_State *L) {
if(lua_isnil(L, 2) || (playerid != 0 && playerid != 1)) if(lua_isnil(L, 2) || (playerid != 0 && playerid != 1))
playerid = PLAYER_NONE; playerid = PLAYER_NONE;
uint32 reason = (uint32)lua_tointeger(L, 3); uint32 reason = (uint32)lua_tointeger(L, 3);
uint32 reason_player = pduel->game_field->core.reason_player;
if (lua_gettop(L) >= 4)
reason_player = (uint32)lua_tointeger(L, 4);
if(pcard) if(pcard)
pduel->game_field->send_to(pcard, pduel->game_field->core.reason_effect, reason, pduel->game_field->core.reason_player, playerid, LOCATION_HAND, 0, POS_FACEUP); pduel->game_field->send_to(pcard, pduel->game_field->core.reason_effect, reason, reason_player, playerid, LOCATION_HAND, 0, POS_FACEUP);
else else
pduel->game_field->send_to(&(pgroup->container), pduel->game_field->core.reason_effect, reason, pduel->game_field->core.reason_player, playerid, LOCATION_HAND, 0, POS_FACEUP); pduel->game_field->send_to(&(pgroup->container), pduel->game_field->core.reason_effect, reason, reason_player, playerid, LOCATION_HAND, 0, POS_FACEUP);
return lua_yieldk(L, 0, (lua_KContext)pduel, [](lua_State *L, int32 status, lua_KContext ctx) { return lua_yieldk(L, 0, (lua_KContext)pduel, [](lua_State *L, int32 status, lua_KContext ctx) {
duel* pduel = (duel*)ctx; duel* pduel = (duel*)ctx;
lua_pushinteger(L, pduel->game_field->returns.ivalue[0]); lua_pushinteger(L, pduel->game_field->returns.ivalue[0]);
......
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