Skip to content

Commit

Permalink
update release location (#705)
Browse files Browse the repository at this point in the history
* update release location

* update duel_rule check
  • Loading branch information
salix5 authored Jan 2, 2025
1 parent 85dd198 commit 567165e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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
4 changes: 2 additions & 2 deletions operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3779,7 +3779,7 @@ int32_t field::destroy(uint16_t step, group * targets, effect * reason_effect, u
return TRUE;
}
int32_t field::release_replace(uint16_t step, group* targets, card* target) {
if(!(target->current.location & (LOCATION_ONFIELD | LOCATION_HAND))) {
if(target->current.location & (LOCATION_GRAVE | LOCATION_REMOVED)) {
target->current.reason = target->temp.reason;
target->current.reason_effect = target->temp.reason_effect;
target->current.reason_player = target->temp.reason_player;
Expand Down Expand Up @@ -3836,7 +3836,7 @@ int32_t field::release(uint16_t step, group * targets, effect * reason_effect, u
if(cv.size() > 1)
std::sort(cv.begin(), cv.end(), card::card_operation_sort);
for (auto& pcard : cv) {
if(!(pcard->current.location & (LOCATION_ONFIELD | LOCATION_HAND))) {
if(pcard->current.location & (LOCATION_GRAVE | LOCATION_REMOVED)) {
pcard->current.reason = pcard->temp.reason;
pcard->current.reason_effect = pcard->temp.reason_effect;
pcard->current.reason_player = pcard->temp.reason_player;
Expand Down

0 comments on commit 567165e

Please sign in to comment.