Skip to content

Commit

Permalink
[MIRROR] Improved nightshift check on security level change [MDB IGNO…
Browse files Browse the repository at this point in the history
…RE] (#362)

* Improved nightshift check on security level change (#79369)

---------

Co-authored-by: lessthanthree <[email protected]>
  • Loading branch information
Steals-The-PRs and lessthnthree authored Oct 31, 2023
1 parent 53db553 commit fc2bc2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/controllers/subsystem/security_level.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ SUBSYSTEM_DEF(security_level)
if(!selected_level)
CRASH("set_level was called with an invalid security level([new_level])")

if(SSnightshift.can_fire && (selected_level.number_level >= SEC_LEVEL_RED || current_security_level.number_level >= SEC_LEVEL_RED))
SSnightshift.next_fire = world.time + 7 SECONDS // Fire nightshift after the security level announcement is complete

level_announce(selected_level, current_security_level.number_level) // We want to announce BEFORE updating to the new level

SSsecurity_level.current_security_level = selected_level
Expand All @@ -53,7 +56,6 @@ SUBSYSTEM_DEF(security_level)
SSshuttle.emergency.alert_coeff_change(selected_level.shuttle_call_time_mod)

SEND_SIGNAL(src, COMSIG_SECURITY_LEVEL_CHANGED, selected_level.number_level)
SSnightshift.check_nightshift()
SSblackbox.record_feedback("tally", "security_level_changes", 1, selected_level.name)

/**
Expand Down

0 comments on commit fc2bc2f

Please sign in to comment.