Commit 73f77238 authored by mercury233's avatar mercury233 Committed by GitHub

update chain_operation_sort (#585)

parent 0e3d5d19
...@@ -16,10 +16,15 @@ ...@@ -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}; 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) { 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) auto e1 = c1.triggering_effect;
return c1.triggering_effect->id < c2.triggering_effect->id; auto e2 = c2.triggering_effect;
else if (e1 && e2) {
return c1.chain_id < c2.chain_id; 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) { void chain::set_triggering_state(card* pcard) {
triggering_controler = pcard->current.controler; triggering_controler = pcard->current.controler;
......
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