From 4c5b7655b55248062865c2b6a3f44a9f084da5e7 Mon Sep 17 00:00:00 2001 From: Leshana Date: Thu, 8 Mar 2018 14:04:20 -0500 Subject: [PATCH] U_I Phase 2.5: Fix *swish deleting tail overlay All more cases of "don't call apply/remove multiple times! --- code/controllers/subsystems/overlays.dm | 6 ++++-- code/modules/holodeck/HolodeckObjects.dm | 4 ++-- code/modules/mob/living/carbon/human/update_icons.dm | 8 ++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/code/controllers/subsystems/overlays.dm b/code/controllers/subsystems/overlays.dm index 352102e1755..052cb96cba1 100644 --- a/code/controllers/subsystems/overlays.dm +++ b/code/controllers/subsystems/overlays.dm @@ -11,6 +11,8 @@ SUBSYSTEM_DEF(overlays) var/list/overlay_icon_state_caches // Cache thing var/list/overlay_icon_cache // Cache thing +var/global/image/stringbro = new() // Temporarily super-global because of BYOND init order dumbness. +var/global/image/iconbro = new() // Temporarily super-global because of BYOND init order dumbness. var/global/image/appearance_bro = new() // Temporarily super-global because of BYOND init order dumbness. /datum/controller/subsystem/overlays/PreInit() @@ -66,7 +68,7 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B count = 0 /proc/iconstate2appearance(icon, iconstate) - var/static/image/stringbro = new() + // var/static/image/stringbro = new() // Moved to be superglobal due to BYOND insane init order stupidness. var/list/icon_states_cache = SSoverlays.overlay_icon_state_caches var/list/cached_icon = icon_states_cache[icon] if (cached_icon) @@ -83,7 +85,7 @@ var/global/image/appearance_bro = new() // Temporarily super-global because of B return cached_appearance /proc/icon2appearance(icon) - var/static/image/iconbro = new() + // var/static/image/iconbro = new() // Moved to be superglobal due to BYOND insane init order stupidness. var/list/icon_cache = SSoverlays.overlay_icon_cache . = icon_cache[icon] if (!.) diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index 7892865a5fc..7432cda5895 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -104,8 +104,8 @@ base_icon = 'icons/turf/flooring/asteroid.dmi' initial_flooring = null -/turf/simulated/floor/holofloor/desert/New() - ..() +/turf/simulated/floor/holofloor/desert/initialize() + . = ..() if(prob(10)) add_overlay("asteroid[rand(0,9)]") diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index b265536c431..e42591e9eee 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -835,16 +835,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(tail_overlay && tail_overlay.icon_state == t_state) return //let the existing animation finish - remove_layer(TAIL_LAYER) - - tail_overlay = set_tail_state(t_state) + tail_overlay = set_tail_state(t_state) // Calls remove_layer & apply_layer if(tail_overlay) spawn(20) //check that the animation hasn't changed in the meantime if(overlays_standing[TAIL_LAYER] == tail_overlay && tail_overlay.icon_state == t_state) - animate_tail_stop() - - apply_layer(TAIL_LAYER) + animate_tail_stop() /mob/living/carbon/human/proc/animate_tail_start() if(QDESTROYING(src))