mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Adds busy to flatpack unpacking.
Stops you from spamming the same step to complete a flatpack quickly.
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
|
||||
/obj/structure/closet/crate/flatpack/attackby(var/atom/A, mob/user)
|
||||
if(assembling)
|
||||
if(unpacking.assemble_busy)
|
||||
return
|
||||
if(unpacking.action(A, user))
|
||||
return 1
|
||||
if(istype(A, /obj/item/weapon/crowbar) && !assembling)
|
||||
@@ -57,6 +59,7 @@
|
||||
|
||||
/datum/construction/flatpack_unpack
|
||||
steps = list()
|
||||
var/assemble_busy = 0
|
||||
|
||||
/datum/construction/flatpack_unpack/New(var/atom/A)
|
||||
var/last_step = ""
|
||||
@@ -105,10 +108,13 @@
|
||||
var/valid_step = is_right_key(user,used_atom)
|
||||
if(valid_step)
|
||||
if(custom_action(valid_step, used_atom, user))
|
||||
assemble_busy = 1
|
||||
if(do_after(user, 30))
|
||||
assemble_busy = 0
|
||||
var/list/step = steps[steps.len]
|
||||
user << "You successfully [step["action"]] in the assembly."
|
||||
next_step(user)
|
||||
assemble_busy = 0
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user