[MIRROR] Fixes forged agent id cards breaking wallets [MDB IGNORE] (#9854)

* Fixes forged agent id cards breaking wallets (#63069)

Forged agent ids no longer prevent access from being combines from cards in a wallet

* Fixes forged agent id cards breaking wallets

Co-authored-by: HarseTheef <74737391+HarseTheef@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-12-03 15:14:58 -05:00
committed by GitHub
co-authored by HarseTheef
parent 500a03de22
commit 3c9610c63d
+9 -6
View File
@@ -57,16 +57,19 @@
front_id = null
var/winning_tally = 0
var/is_magnetic_found = FALSE
for(var/obj/item/card/id/id_card in contents)
// Certain IDs can forcibly jump to the front so they can disguise other cards in wallets. Chameleon/Agent ID cards are an example of this.
if(HAS_TRAIT(id_card, TRAIT_MAGNETIC_ID_CARD))
if(!is_magnetic_found && HAS_TRAIT(id_card, TRAIT_MAGNETIC_ID_CARD))
front_id = id_card
break
is_magnetic_found = TRUE
if(!is_magnetic_found)
var/card_tally = SSid_access.tally_access(id_card, ACCESS_FLAG_COMMAND)
if(card_tally > winning_tally)
winning_tally = card_tally
front_id = id_card
var/card_tally = SSid_access.tally_access(id_card, ACCESS_FLAG_COMMAND)
if(card_tally > winning_tally)
winning_tally = card_tally
front_id = id_card
LAZYINITLIST(combined_access)
combined_access |= id_card.access