From 0adf5f64a7ae81476e534ea5d77d34b2d7d67c2a Mon Sep 17 00:00:00 2001 From: coiax Date: Sat, 15 Apr 2017 18:22:12 +0100 Subject: [PATCH] Ghosts call Moved() after Move() (#26183) * Ghosts call Moved() after Move() I was tinkering around with making ghosts glow when visible, and I had to put this in to make lighting and stuff work. This seems sensible anyway? * Locate->get_turf * Removes step trigger calling (done by Moved) --- code/modules/mob/dead/observer/observer.dm | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 4175f75744f..8f98589ced9 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -272,25 +272,24 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/Move(NewLoc, direct) if(updatedir) - setDir(direct )//only update dir if we actually need it, so overlays won't spin on base sprites that don't have directions of their own + setDir(direct)//only update dir if we actually need it, so overlays won't spin on base sprites that don't have directions of their own + var/oldloc = loc + if(NewLoc) loc = NewLoc - for(var/obj/effect/step_trigger/S in NewLoc) - S.Crossed(src) update_parallax_contents() - return - loc = get_turf(src) //Get out of closets and such as a ghost - if((direct & NORTH) && y < world.maxy) - y++ - else if((direct & SOUTH) && y > 1) - y-- - if((direct & EAST) && x < world.maxx) - x++ - else if((direct & WEST) && x > 1) - x-- + else + loc = get_turf(src) //Get out of closets and such as a ghost + if((direct & NORTH) && y < world.maxy) + y++ + else if((direct & SOUTH) && y > 1) + y-- + if((direct & EAST) && x < world.maxx) + x++ + else if((direct & WEST) && x > 1) + x-- - for(var/obj/effect/step_trigger/S in locate(x, y, z)) //<-- this is dumb - S.Crossed(src) + Moved(oldloc, direct) /mob/dead/observer/is_active() return 0