From 19c35c63d6b0a91fa3906f4b2a0a6f86f2c7dc23 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sun, 31 Dec 2017 10:57:03 -0500 Subject: [PATCH] Merge pull request #33951 from AnturK/perspective_fix Fixes reset_perspective runtimes --- code/modules/mob/mob.dm | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a818a01764..1bc7552c3f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -254,24 +254,43 @@ return 0 +// reset_perspective(thing) set the eye to the thing (if it's equal to current default reset to mob perspective) +// reset_perspective() set eye to common default : mob on turf, loc otherwise /mob/proc/reset_perspective(atom/A) if(client) - if(ismovableatom(A)) - client.perspective = EYE_PERSPECTIVE - client.eye = A + if(A) + if(ismovableatom(A)) + //Set the the thing unless it's us + if(A != src) + client.perspective = EYE_PERSPECTIVE + client.eye = A + else + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE + else if(isturf(A)) + //Set to the turf unless it's our current turf + if(A != loc) + client.perspective = EYE_PERSPECTIVE + client.eye = A + else + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE + else + //Do nothing else - if(isturf(loc) && (!A || loc == A)) + //Reset to common defaults: mob if on turf, otherwise current loc + if(isturf(loc)) client.eye = client.mob client.perspective = MOB_PERSPECTIVE else client.perspective = EYE_PERSPECTIVE - client.eye = A + client.eye = loc return 1 /mob/living/reset_perspective(atom/A) if(..()) update_sight() - if(client.eye != src) + if(client.eye && client.eye != src) var/atom/AT = client.eye AT.get_remote_view_fullscreens(src) else