From d919eae075322679439c6c68245b7a41933bb658 Mon Sep 17 00:00:00 2001 From: oranges Date: Sun, 17 Dec 2017 17:09:13 +1300 Subject: [PATCH 1/3] add view range respects widescreen (#33581) It will simply increment the x and y independently This prevents a runtime of trying to add a number to a string --- code/modules/client/client_procs.dm | 7 +++++++ code/modules/mob/dead/observer/observer.dm | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index cb1712dff5..6c11a6d10a 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -673,6 +673,13 @@ GLOBAL_LIST(external_rsc_urls) return TRUE . = ..() +/client/proc/rescale_view(change, min, max) + var/viewscale = getviewsize(view) + var/x = viewscale[1] + var/y = viewscale[2] + x = Clamp(x+change, min, max) + y = Clamp(y+change, min,max) + change_view("[x]x[y]") /client/proc/change_view(new_size) if (isnull(new_size)) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index d19f3d4bf8..4ae841cfa5 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -471,7 +471,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set hidden = TRUE var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT if(input) - client.change_view(Clamp(client.view + input, 7, max_view)) + client.rescale_view(input, 7, max_view) /mob/dead/observer/verb/boo() set category = "Ghost" From 680e44fb6479be287762e0ce11421411f309cc09 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 20 Dec 2017 22:56:46 -0500 Subject: [PATCH 3/3] Update observer.dm --- code/modules/mob/dead/observer/observer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 4ecae3730d..4481de1e36 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -471,7 +471,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set hidden = TRUE var/max_view = client.prefs.unlock_content ? GHOST_MAX_VIEW_RANGE_MEMBER : GHOST_MAX_VIEW_RANGE_DEFAULT if(input) - client.change_view(CLAMP(client.view + input, 7, max_view)) + client.rescale_view(input, 7, max_view) /mob/dead/observer/verb/boo() set category = "Ghost"