From 3c9610c63d3015bd018457c44f2515fbb5a70da3 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 3 Dec 2021 21:14:58 +0100 Subject: [PATCH] [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> --- code/game/objects/items/storage/wallets.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 35aa743cfb2..e58cab6c656 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -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