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.
This commit is contained in:
san7890
2022-09-25 12:49:11 -06:00
committed by GitHub
parent 8d1bb856c0
commit d45e244401
+6 -1
View File
@@ -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()