Fixes movement issues with opening and closing closets

Fixes #3687
Mobs no longer act as if they've moved when in a locker whilst it's
opened and closed.
The new proc does everything forceMove does except trigger /crossed on
/items and run the extra code in turfs\simulated\Entered (still makes
the parent call)
Also removed some now unneeded code from the /slip proc as this makes it
redundant
This commit is contained in:
VampyrBytes
2016-02-24 21:23:38 +00:00
parent 0266fe9109
commit 42f4f9b3d2
3 changed files with 60 additions and 54 deletions
@@ -55,11 +55,20 @@
I.forceMove(loc)
for(var/mob/M in src)
M.forceMove(loc)
moveMob(M, loc)
if(M.client)
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
/obj/structure/closet/proc/moveMob(var/mob/M, var/atom/destination)
loc.Exited(M)
M.loc = destination
loc.Entered(M, ignoreRest = 1)
for (var/atom/movable/AM in loc)
if (istype(AM, /obj/item))
continue
AM.Crossed(M)
/obj/structure/closet/proc/open()
if(src.opened)
return 0
@@ -112,7 +121,7 @@
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.forceMove(src)
moveMob(M, src)
itemcount++
src.icon_state = src.icon_closed