Merge pull request #8998 from Ghommie/Ghommie-cit167
Fixes inactive high luminosity eyes turning back on as soon as you move around.
This commit is contained in:
@@ -169,7 +169,6 @@
|
|||||||
var/list/obj/effect/abstract/eye_lighting/eye_lighting
|
var/list/obj/effect/abstract/eye_lighting/eye_lighting
|
||||||
var/obj/effect/abstract/eye_lighting/on_mob
|
var/obj/effect/abstract/eye_lighting/on_mob
|
||||||
var/image/mob_overlay
|
var/image/mob_overlay
|
||||||
var/datum/component/mobhook
|
|
||||||
|
|
||||||
/obj/item/organ/eyes/robotic/glow/Initialize()
|
/obj/item/organ/eyes/robotic/glow/Initialize()
|
||||||
. = ..()
|
. = ..()
|
||||||
@@ -238,26 +237,18 @@
|
|||||||
return
|
return
|
||||||
deactivate(silent = TRUE)
|
deactivate(silent = TRUE)
|
||||||
|
|
||||||
/obj/item/organ/eyes/robotic/glow/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = FALSE)
|
|
||||||
. = ..()
|
|
||||||
if (mobhook && mobhook.parent != M)
|
|
||||||
QDEL_NULL(mobhook)
|
|
||||||
if (!mobhook)
|
|
||||||
mobhook = M.AddComponent(/datum/component/redirect, list(COMSIG_ATOM_DIR_CHANGE = CALLBACK(src, .proc/update_visuals)))
|
|
||||||
|
|
||||||
/obj/item/organ/eyes/robotic/glow/Remove(mob/living/carbon/M)
|
/obj/item/organ/eyes/robotic/glow/Remove(mob/living/carbon/M)
|
||||||
. = ..()
|
. = ..()
|
||||||
QDEL_NULL(mobhook)
|
if(active)
|
||||||
|
UnregisterSignal(M, COMSIG_ATOM_DIR_CHANGE)
|
||||||
/obj/item/organ/eyes/robotic/glow/Destroy()
|
active = FALSE
|
||||||
QDEL_NULL(mobhook) // mobhook is not our component
|
|
||||||
return ..()
|
|
||||||
|
|
||||||
/obj/item/organ/eyes/robotic/glow/proc/activate(silent = FALSE)
|
/obj/item/organ/eyes/robotic/glow/proc/activate(silent = FALSE)
|
||||||
start_visuals()
|
start_visuals()
|
||||||
if(!silent)
|
if(!silent)
|
||||||
to_chat(owner, "<span class='warning'>Your [src] clicks and makes a whining noise, before shooting out a beam of light!</span>")
|
to_chat(owner, "<span class='warning'>Your [src] clicks and makes a whining noise, before shooting out a beam of light!</span>")
|
||||||
active = TRUE
|
active = TRUE
|
||||||
|
RegisterSignal(owner, COMSIG_ATOM_DIR_CHANGE, .proc/update_visuals)
|
||||||
cycle_mob_overlay()
|
cycle_mob_overlay()
|
||||||
|
|
||||||
/obj/item/organ/eyes/robotic/glow/proc/deactivate(silent = FALSE)
|
/obj/item/organ/eyes/robotic/glow/proc/deactivate(silent = FALSE)
|
||||||
@@ -265,6 +256,7 @@
|
|||||||
if(!silent)
|
if(!silent)
|
||||||
to_chat(owner, "<span class='warning'>Your [src] shuts off!</span>")
|
to_chat(owner, "<span class='warning'>Your [src] shuts off!</span>")
|
||||||
active = FALSE
|
active = FALSE
|
||||||
|
UnregisterSignal(owner, COMSIG_ATOM_DIR_CHANGE)
|
||||||
remove_mob_overlay()
|
remove_mob_overlay()
|
||||||
|
|
||||||
/obj/item/organ/eyes/robotic/glow/proc/update_visuals(datum/source, olddir, newdir)
|
/obj/item/organ/eyes/robotic/glow/proc/update_visuals(datum/source, olddir, newdir)
|
||||||
|
|||||||
Reference in New Issue
Block a user