Removes on_mob_turn, on_mob_move and intercept_user_move, speeding up movement (#35679)

* honk

* qdel memes
This commit is contained in:
vuonojenmustaturska
2018-02-16 08:39:59 +02:00
committed by CitadelStationBot
parent 757df53aa3
commit 6dfa89fab7
9 changed files with 93 additions and 81 deletions
+18 -10
View File
@@ -161,6 +161,7 @@
var/list/obj/effect/abstract/eye_lighting/eye_lighting
var/obj/effect/abstract/eye_lighting/on_mob
var/image/mob_overlay
var/datum/component/mobhook
/obj/item/organ/eyes/robotic/glow/Initialize()
. = ..()
@@ -227,15 +228,20 @@
if(active)
deactivate(silent = TRUE)
/obj/item/organ/eyes/robotic/glow/on_mob_move()
if(QDELETED(owner) || !active)
return
update_visuals()
/obj/item/organ/eyes/robotic/glow/Insert(var/mob/living/carbon/M)
. = ..()
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/on_mob_turn()
if(QDELETED(owner) || !active)
return
update_visuals()
/obj/item/organ/eyes/robotic/glow/Remove(mob/living/carbon/M)
. = ..()
QDEL_NULL(mobhook)
/obj/item/organ/eyes/robotic/glow/Destroy()
QDEL_NULL(mobhook) // mobhook is not our component
return ..()
/obj/item/organ/eyes/robotic/glow/proc/activate(silent = FALSE)
start_visuals()
@@ -251,11 +257,13 @@
active = FALSE
remove_mob_overlay()
/obj/item/organ/eyes/robotic/glow/proc/update_visuals()
/obj/item/organ/eyes/robotic/glow/proc/update_visuals(olddir, newdir)
if((LAZYLEN(eye_lighting) < light_beam_distance) || !on_mob)
regenerate_light_effects()
var/turf/scanfrom = get_turf(owner)
var/scandir = owner.dir
if (newdir && scandir != newdir) // COMSIG_ATOM_DIR_CHANGE happens before the dir change, but with a reference to the new direction.
scandir = newdir
if(!istype(scanfrom))
clear_visuals()
var/turf/scanning = scanfrom
@@ -320,4 +328,4 @@
/obj/item/organ/eyes/moth
name = "moth eyes"
desc = "These eyes seem to have increased sensitivity to bright light, with no improvement to low light vision."
flash_protect = -1
flash_protect = -1