Skip to content

Commit

Permalink
Prevents spamming open and close tarps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 committed Jun 29, 2023
1 parent 5700c6c commit 014777b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions code/modules/cm_marines/equipment/gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
anchored = FALSE
var/uncloak_time = 3 //in SECONDS, this is how long it takes for the tarp to become fully visible again once it's opened from an invisible state
var/cloak_time = 15 //ditto for cloaking
var/delay_time = 0 //in SECONDS, used to implement a delay before tarp can be entered again after opened (anti-exploit)
var/closed_alpha = 60 //how much ALPHA the tarp has once it's fully cloaked.
var/can_store_dead = FALSE
var/is_animating = FALSE
Expand Down Expand Up @@ -137,10 +138,14 @@
return

/obj/structure/closet/bodybag/tarp/open()
delay_time = world.time + 3 SECONDS //3 seconds must past before tarp can be closed again
. = ..()
handle_cloaking()

/obj/structure/closet/bodybag/tarp/close()
if(delay_time > world.time)
to_chat(usr, SPAN_WARNING("It is too soon to close the [src]!"))
return FALSE
. = ..()
handle_cloaking()

Expand Down

0 comments on commit 014777b

Please sign in to comment.