From d45e244401425d34edc38e3dd2f3c2bbdbcec7ce Mon Sep 17 00:00:00 2001 From: san7890 Date: Sun, 25 Sep 2022 12:49:11 -0600 Subject: [PATCH] Crab-17 No Longer Breaks Economy If You Swipe Too Fast (#70094) Hey there, Remember swiping credit cards, before everything was chipped? You know how sometimes if you went too slow, the transaction might fail, the cashier had to plonk in some digits on their machine, and you had to go again? That kinda sucked. If you're too young to get that reference, just imagine the card swiping task in AMONG US. Doesn't that minigame suck? You know exactly what that is. Same principle. Anyways, that's pretty much what was going on here. The reason why SS.Economy would break so god damn hard if you swiped an ID before the machine's "boot up" slowflake animation was complete is probably due to the line where it starts fast processing. I added an early return to check for if the animation was complete by leveraging a var we already set at the end of the process, because I am lazy. There's probably a few other ways you can tackle this issue, but this feels right to me in a thematic sense. I'm willing to change it if needed though. --- code/game/objects/items/crab17.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/crab17.dm b/code/game/objects/items/crab17.dm index 88801c55146..71375c1a257 100644 --- a/code/game/objects/items/crab17.dm +++ b/code/game/objects/items/crab17.dm @@ -50,6 +50,7 @@ max_integrity = 5000 var/list/accounts_to_rob var/mob/living/bogdanoff + /// Are we able to start moving? var/canwalk = FALSE /obj/structure/checkoutmachine/examine(mob/living/user) @@ -78,6 +79,10 @@ return + if(!canwalk) + to_chat(user, span_warning("Space-Coin only accepts transactions while mobile!")) + return + if(!card.registered_account) to_chat(user, span_warning("This card does not have a registered account!")) return @@ -166,8 +171,8 @@ add_overlay("screen_lines") cut_overlay("text") add_overlay("text") + START_PROCESSING(SSfastprocess, src) // we only start doing economy draining stuff once our machinery is initialized, thematically canwalk = TRUE - START_PROCESSING(SSfastprocess, src) /obj/structure/checkoutmachine/Destroy() stop_dumping()