From 5c1f4c068aa4ecdc957c4d74d3e27093e7f503a5 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Sun, 3 Dec 2023 18:39:51 +0000 Subject: [PATCH] runtime fix and code maintenance --- code/game/machinery/vending/cm_vending.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index b0a09dcd1767..d00d7dd0d6ae 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -441,13 +441,6 @@ GLOBAL_LIST_EMPTY(vending_products) tgui_interact(user) /// Handles redeeming coin tokens. -/obj/structure/machinery/cm_vending/attackby(obj/item/attacking_item, mob/user) - if(!istype(attacking_item, /obj/item/coin/marine)) - ..() - if(!can_access_to_vend(user, ignore_hack = TRUE)) - return FALSE - redeem_token(attacking_item, user) - /obj/structure/machinery/cm_vending/proc/redeem_token(obj/item/coin/marine/token, mob/user) var/reward_typepath switch(token.token_type) @@ -766,6 +759,13 @@ GLOBAL_LIST_EMPTY(vending_products) hack_access(user) return TRUE + ///If we want to redeem a token + else if(istype(W, /obj/item/coin/marine)) + if(!can_access_to_vend(user, ignore_hack = TRUE)) + return FALSE + redeem_token(W, user) + return FALSE + ..() /obj/structure/machinery/cm_vending/proc/get_listed_products(mob/user)