Add $reset directive to config processor for setting a config entry to default value (#59874)

added this so that the value of INTERVIEW_QUESTIONS (and subsequently any other string list) can be overridden without much issue by additional config files.

i also changed the functionality of default on config_entry as it seemed to be counterintuitive to have it be set to the initial value of the config_entry. in my opinion this should be a compile-time default, and so i've refactored the code such that default now contains the actual default, and the config_entry_value is set at intialization.
This commit is contained in:
Bobbahbrown
2021-06-30 01:20:57 -03:00
committed by GitHub
parent 3542c43c5a
commit 634049e1e9
7 changed files with 160 additions and 130 deletions
+3 -3
View File
@@ -65,11 +65,11 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
configured_error_silence_time = CONFIG_GET(number/error_silence_time)
else
var/datum/config_entry/CE = /datum/config_entry/number/error_cooldown
configured_error_cooldown = initial(CE.config_entry_value)
configured_error_cooldown = initial(CE.default)
CE = /datum/config_entry/number/error_limit
configured_error_limit = initial(CE.config_entry_value)
configured_error_limit = initial(CE.default)
CE = /datum/config_entry/number/error_silence_time
configured_error_silence_time = initial(CE.config_entry_value)
configured_error_silence_time = initial(CE.default)
//Each occurence of a unique error adds to its cooldown time...