From f02d9d79b1098c97ed1dde1e8718b03787ce172f Mon Sep 17 00:00:00 2001 From: Leshana Date: Mon, 15 May 2017 20:45:22 -0400 Subject: [PATCH] Fix mob zshadow update icons and other openspace fixes. * Admin teleports will now update zshadow. * update_icon() now syncs the zshadow. * Objects being deleted will trigger open space update. --- code/modules/multiz/open_space_controller.dm | 8 ++++++++ code/modules/multiz/zshadow.dm | 19 +++++++++++++++++++ code/modules/vore/resizing/resize_vr.dm | 1 + 3 files changed, 28 insertions(+) diff --git a/code/modules/multiz/open_space_controller.dm b/code/modules/multiz/open_space_controller.dm index 770a69b431b..2bd19c45f23 100644 --- a/code/modules/multiz/open_space_controller.dm +++ b/code/modules/multiz/open_space_controller.dm @@ -92,3 +92,11 @@ if(isopenspace(T)) // log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src]New()") OS_controller.add_turf(T, 1) + +// Just as New() we probably should hook Destroy() If we can think of something more efficient, lets hear it. +/obj/Destroy() + if(open_space_initialised && !invisibility) + var/turf/T = GetAbove(src) + if(isopenspace(T)) + OS_controller.add_turf(T, 1) + . = ..() // Important that this be at the bottom, or we will have been moved to nullspace. diff --git a/code/modules/multiz/zshadow.dm b/code/modules/multiz/zshadow.dm index db281a34258..d5d32eb36af 100644 --- a/code/modules/multiz/zshadow.dm +++ b/code/modules/multiz/zshadow.dm @@ -59,6 +59,14 @@ . = ..() check_shadow() +/mob/living/on_mob_jump() + // We're about to be admin-jumped. + // Unfortuantely loc isn't set until after this proc is called. So we must spawn() so check_shadow executes with the new loc. + . = ..() + if(shadow) + spawn(0) + check_shadow() + /mob/living/proc/check_shadow() var/mob/M = src if(isturf(M.loc)) @@ -74,11 +82,22 @@ qdel(M.shadow) M.shadow = null +// +// Handle cases where the owner mob might have changed its icon or overlays. +// + /mob/living/update_icons() . = ..() if(shadow) shadow.sync_icon(src) +// WARNING - the true carbon/human/update_icons does not call ..(), therefore we must sideways override this. +// But be careful, we don't want to screw with that proc. So lets be cautious about what we do here. +/mob/living/carbon/human/update_icons() + . = ..() + if(shadow) + shadow.sync_icon(src) + /mob/set_dir(new_dir) . = ..() if(shadow) diff --git a/code/modules/vore/resizing/resize_vr.dm b/code/modules/vore/resizing/resize_vr.dm index 569af0c3f68..d496fb46fbd 100644 --- a/code/modules/vore/resizing/resize_vr.dm +++ b/code/modules/vore/resizing/resize_vr.dm @@ -38,6 +38,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2 * re-evaluate. */ /mob/living/update_icons() + . = ..() ASSERT(!ishuman(src)) var/matrix/M = matrix() M.Scale(size_multiplier)