Skip to content

Commit

Permalink
update chain_operation_sort (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercury233 authored May 8, 2024
1 parent 0e3d5d1 commit 73f7723
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
int32 field::field_used_count[32] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5};

bool chain::chain_operation_sort(const chain& c1, const chain& c2) {
if (c1.triggering_effect && c2.triggering_effect && c1.triggering_effect->id != c2.triggering_effect->id)
return c1.triggering_effect->id < c2.triggering_effect->id;
else
return c1.chain_id < c2.chain_id;
auto e1 = c1.triggering_effect;
auto e2 = c2.triggering_effect;
if (e1 && e2) {
if (e1->handler == e2->handler && e1->description != e2->description)
return e1->description < e2->description;
if (e1->id != e2->id)
return e1->id < e2->id;
}
return c1.chain_id < c2.chain_id;
}
void chain::set_triggering_state(card* pcard) {
triggering_controler = pcard->current.controler;
Expand Down

0 comments on commit 73f7723

Please sign in to comment.