Commit 1b189a1f authored by Dark Zane's avatar Dark Zane Committed by GitHub

Merge branch 'fallenstardust:master' into master

parents be623cc0 57005175
......@@ -18,7 +18,7 @@
duel::duel() {
lua = new interpreter(this);
game_field = new field(this);
game_field->temp_card = new_card(0);
game_field->temp_card = new_card(TEMP_CARD_ID);
message_buffer.reserve(SIZE_MESSAGE_BUFFER);
#ifdef _WIN32
_set_error_mode(_OUT_TO_MSGBOX);
......@@ -45,8 +45,11 @@ void duel::clear() {
cards.clear();
groups.clear();
effects.clear();
assumes.clear();
sgroups.clear();
uncopy.clear();
game_field = new field(this);
game_field->temp_card = new_card(0);
game_field->temp_card = new_card(TEMP_CARD_ID);
}
card* duel::new_card(uint32_t code) {
card* pcard = new card(this);
......
......@@ -148,10 +148,6 @@ int32_t scriptlib::debug_reload_field_begin(lua_State *L) {
pduel->game_field->core.duel_rule = 1;
else
pduel->game_field->core.duel_rule = CURRENT_RULE;
if (pduel->game_field->core.duel_rule == MASTER_RULE3) {
pduel->game_field->player[0].szone_size = 8;
pduel->game_field->player[1].szone_size = 8;
}
return 0;
}
int32_t scriptlib::debug_reload_field_end(lua_State *L) {
......
......@@ -70,13 +70,14 @@ extern "C" DECL_DLLEXPORT intptr_t create_duel(uint_fast32_t seed) {
}
extern "C" DECL_DLLEXPORT void start_duel(intptr_t pduel, uint32_t options) {
duel* pd = (duel*)pduel;
pd->game_field->core.duel_options |= options & 0xffff;
int32_t duel_rule = options >> 16;
uint16_t duel_rule = options >> 16;
uint16_t duel_options = options & 0xffff;
pd->game_field->core.duel_options |= duel_options;
if (duel_rule >= 1 && duel_rule <= CURRENT_RULE)
pd->game_field->core.duel_rule = duel_rule;
else if(options & DUEL_OBSOLETE_RULING) //provide backward compatibility with replay
pd->game_field->core.duel_rule = 1;
else
if (pd->game_field->core.duel_rule < 1 || pd->game_field->core.duel_rule > CURRENT_RULE)
pd->game_field->core.duel_rule = CURRENT_RULE;
if (pd->game_field->core.duel_rule == MASTER_RULE3) {
pd->game_field->player[0].szone_size = 8;
......
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