Fix halloweens races (#70874)

* Fixes halloween races.
- Fixes a race condition involve checking for holidays befores SSevents is instantiated. Now, holiday checking is done through a helper, which will ensure the holidays list is created and filled before checked.
This commit is contained in:
MrMelbert
2022-10-31 16:01:31 +01:00
committed by GitHub
parent ed55e9ba01
commit a1ab0201ff
35 changed files with 106 additions and 89 deletions
@@ -7,16 +7,15 @@
#define PRIDE_ALPHA 60
/obj/effect/turf_decal/tile/Initialize(mapload)
if(SSevents.holidays)
if (SSevents.holidays[APRIL_FOOLS])
color = "#[random_short_color()]"
else if (SSevents.holidays[PRIDE_WEEK])
var/datum/holiday/pride_week/pride_week = SSevents.holidays[PRIDE_WEEK]
color = pride_week.get_floor_tile_color(src)
if (check_holidays(APRIL_FOOLS))
color = "#[random_short_color()]"
else if (check_holidays(PRIDE_WEEK))
var/datum/holiday/pride_week/pride_week = GLOB.holidays[PRIDE_WEEK]
color = pride_week.get_floor_tile_color(src)
// It looks garish at different alphas, and it's not possible to get a
// consistent color palette without this.
alpha = PRIDE_ALPHA
// It looks garish at different alphas, and it's not possible to get a
// consistent color palette without this.
alpha = PRIDE_ALPHA
return ..()
#undef PRIDE_ALPHA
@@ -580,7 +579,7 @@
icon_state = "trimline_box"
/obj/effect/turf_decal/trimline/Initialize(mapload)
if(SSevents.holidays && SSevents.holidays[APRIL_FOOLS])
if(check_holidays(APRIL_FOOLS))
color = "#[random_short_color()]"
. = ..()