Skip to content

Commit

Permalink
update duel_rule check
Browse files Browse the repository at this point in the history
  • Loading branch information
salix5 committed Jan 2, 2025
1 parent b1eba32 commit 0b07e04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocgapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ 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;
if(duel_rule)
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;
if (pd->game_field->core.duel_rule < 1 || pd->game_field->core.duel_rule > CURRENT_RULE)
else
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;
Expand Down

0 comments on commit 0b07e04

Please sign in to comment.