Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevents spamming open and close tarps #3768

Merged
merged 7 commits into from
Jun 30, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
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
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
handle_cloaking()

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

Expand Down