Skip to content

Commit

Permalink
[GBP no update] Fixes Possible Firealarm spam (#18143)
Browse files Browse the repository at this point in the history
* Yep

* SteelSlayer Suggestion

Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
  • Loading branch information
kugamo and SteelSlayer authored Jul 1, 2022
1 parent f664644 commit 26bd519
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ FIRE ALARM
var/report_fire_alarms = TRUE // Should triggered fire alarms also trigger an actual alarm?
var/show_alert_level = TRUE // Should fire alarms display the current alert level?

var/last_time_pulled //used to prevent pulling spam by same persons

/obj/machinery/firealarm/no_alarm
report_fire_alarms = FALSE

Expand Down Expand Up @@ -227,13 +229,18 @@ FIRE ALARM
if(user.incapacitated())
return 1

if(fingerprintslast == user.ckey && world.time < last_time_pulled + 2 SECONDS) //no spamming >:C
to_chat(user, "<span class='warning'>[src] is still processing your earlier command.</span>")
return

toggle_alarm(user)


/obj/machinery/firealarm/proc/toggle_alarm(mob/user)
var/area/A = get_area(src)
if(istype(A))
add_fingerprint(user)
last_time_pulled = world.time
if(A.fire)
reset()
else
Expand Down

0 comments on commit 26bd519

Please sign in to comment.