fix Madness not skipping HUNTERS_SC with items equipped

This commit is contained in:
Martin Michelsen
2023-09-12 17:54:57 -07:00
parent f708ecc035
commit b07748d07f
+9 -10
View File
@@ -3074,15 +3074,14 @@ vector<shared_ptr<const Card>> CardSpecial::get_targeted_cards_for_condition(
for (uint16_t result_card_ref : result_card_refs) { for (uint16_t result_card_ref : result_card_refs) {
auto result_card = this->server()->card_for_set_card_ref(result_card_ref); auto result_card = this->server()->card_for_set_card_ref(result_card_ref);
if (result_card) { if (result_card) {
auto def = result_card->get_definition(); auto result_ce = result_card->get_definition();
if (ce->def.type == CardType::HUNTERS_SC) { if (result_ce->def.type == CardType::HUNTERS_SC) {
bool should_add = true; bool should_add = true;
for (uint16_t other_result_card_ref : result_card_refs) { for (uint16_t other_result_card_ref : result_card_refs) {
if (other_result_card_ref != result_card_ref) { if ((other_result_card_ref != result_card_ref) &&
if (client_id_for_card_ref(other_result_card_ref) == client_id_for_card_ref(result_card_ref)) { (client_id_for_card_ref(other_result_card_ref) == client_id_for_card_ref(result_card_ref))) {
should_add = false; should_add = false;
break; break;
}
} }
} }
if (should_add) { if (should_add) {
@@ -3094,9 +3093,9 @@ vector<shared_ptr<const Card>> CardSpecial::get_targeted_cards_for_condition(
} }
} }
} }
auto result_card = this->server()->card_for_set_card_ref(setter_card_ref); auto setter_card = this->server()->card_for_set_card_ref(setter_card_ref);
if (result_card) { if (setter_card) {
ret.emplace_back(result_card); ret.emplace_back(setter_card);
} }
} }
break; break;