Commit d73551da authored by mercury233's avatar mercury233

Merge branch 'master' into patch-rule

parents 8996a960 bf74fbb6
......@@ -39,6 +39,8 @@ int32 scriptlib::debug_add_card(lua_State *L) {
if(pduel->game_field->is_location_useable(playerid, location, sequence)) {
card* pcard = pduel->new_card(code);
pcard->owner = owner;
if(location == LOCATION_EXTRA && position == 0)
position = POS_FACEDOWN_DEFENSE;
pcard->sendto_param.position = position;
if(location == LOCATION_PZONE) {
int32 seq = pduel->game_field->core.duel_rule >= 4 ? sequence * 4 : sequence + 6;
......
......@@ -1869,7 +1869,7 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) {
return 0;
duel* pduel = interpreter::get_duel_info(L);
uint32 uplayer = pduel->game_field->core.reason_player;
if(lua_gettop(L) >= 2)
if(lua_gettop(L) >= 2 && !lua_isnil(L, 2))
uplayer = lua_tointeger(L, 2);
bool swapped = false;
card* mcard = 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