diff --git a/code/controllers/subsystem/economy.dm b/code/controllers/subsystem/economy.dm index aa90ee413cd..c146887ba29 100644 --- a/code/controllers/subsystem/economy.dm +++ b/code/controllers/subsystem/economy.dm @@ -65,6 +65,8 @@ SUBSYSTEM_DEF(economy) /// Tracks a temporary sum of all money in the system /// We need this on the subsystem because of yielding and such var/temporary_total = 0 + /// Determines how many ticks it takes to restock mail + var/ticks_per_mail = 2 /datum/controller/subsystem/economy/Initialize() //removes cargo from the split @@ -90,7 +92,6 @@ SUBSYSTEM_DEF(economy) /datum/controller/subsystem/economy/fire(resumed = 0) var/seconds_per_tick = wait / (5 MINUTES) - if(!resumed) temporary_total = 0 processing_part = ECON_DEPARTMENT_STEP @@ -116,8 +117,9 @@ SUBSYSTEM_DEF(economy) if(!HAS_TRAIT(SSeconomy, TRAIT_MARKET_CRASHING) && !price_update()) return - var/effective_mailcount = round(living_player_count()/(inflation_value - 0.5)) //More mail at low inflation, and vis versa. - mail_waiting += clamp(effective_mailcount, 1, MAX_MAIL_PER_MINUTE * seconds_per_tick) + if(times_fired % ticks_per_mail == 0) + var/effective_mailcount = round(living_player_count() / (inflation_value - 0.5)) //More mail at low inflation, and vis versa. + mail_waiting += clamp(effective_mailcount, 1, ticks_per_mail * MAX_MAIL_PER_MINUTE * seconds_per_tick) SSstock_market.news_string = "" diff --git a/code/modules/security_levels/security_level_datums.dm b/code/modules/security_levels/security_level_datums.dm index 0ba614a1556..c6d8ed774be 100644 --- a/code/modules/security_levels/security_level_datums.dm +++ b/code/modules/security_levels/security_level_datums.dm @@ -35,6 +35,8 @@ var/lowering_to_configuration_key /// Our configuration key for elevating to text, if set, will override the default elevating to announcement. var/elevating_to_configuration_key + /// if TRUE, stops mail shipments from being sent during this security level + var/disables_mail = FALSE /datum/security_level/New() . = ..() @@ -92,7 +94,7 @@ lowering_to_configuration_key = /datum/config_entry/string/alert_red_downto elevating_to_configuration_key = /datum/config_entry/string/alert_red_upto shuttle_call_time_mod = ALERT_COEFF_RED - + disables_mail = TRUE /** * DELTA * @@ -108,3 +110,4 @@ fire_alarm_light_color = LIGHT_COLOR_INTENSE_RED elevating_to_configuration_key = /datum/config_entry/string/alert_delta shuttle_call_time_mod = ALERT_COEFF_DELTA + disables_mail = TRUE diff --git a/code/modules/shuttle/mobile_port/variants/supply.dm b/code/modules/shuttle/mobile_port/variants/supply.dm index 54f7548aff2..c6d37d81a64 100644 --- a/code/modules/shuttle/mobile_port/variants/supply.dm +++ b/code/modules/shuttle/mobile_port/variants/supply.dm @@ -306,7 +306,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( */ /obj/docking_port/mobile/supply/proc/create_mail() //Early return if there's no mail waiting to prevent taking up a slot. We also don't send mails on sundays or holidays. - if(!SSeconomy.mail_waiting || SSeconomy.mail_blocked) + if(!SSeconomy.mail_waiting || SSeconomy.mail_blocked || SSsecurity_level.current_security_level.disables_mail) return //spawn crate