From e00814e36c675a8d068fd20779a5b75a735e3c33 Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Wed, 21 Dec 2016 22:31:13 -0500 Subject: [PATCH 1/2] Cameras Now Handle Disguises Fixes a bug where you could take a picture of stuff behind walls (ghetto X-Ray). Pictures will now render people with disguises as you see them (borgs see people with cardborg suits as borgs, people with cardborg suits see themselves as borgs, everyone sees people carrying plants as plants) although they will also state the person's name, regardless of disguise (same as mouseover). --- code/modules/paperwork/photography.dm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 364f7b50f02..05130c57a13 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -207,7 +207,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s ..() -/obj/item/device/camera/proc/get_icon(list/turfs, turf/center,mob/user) +/obj/item/device/camera/proc/get_icon(list/turfs, turf/center, mob/user) //Bigger icon base to capture those icons that were shifted to the next tile //i.e. pretty much all wall-mounted machinery @@ -218,11 +218,11 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s var/atoms[] = list() for(var/turf/the_turf in turfs) - // Add outselves to the list of stuff to draw + // Add ourselves to the list of stuff to draw atoms.Add(the_turf); // As well as anything that isn't invisible. for(var/atom/A in the_turf) - if(A.invisibility ) + if(A.invisibility) if(see_ghosts && istype(A,/mob/dead/observer)) var/mob/dead/observer/O = A if(O.following) @@ -234,7 +234,16 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s else//its not a ghost continue else//not invisable, not a spookyghost add it. - atoms.Add(A) + var/disguised = null + if(user.viewing_alternate_appearances && user.viewing_alternate_appearances.len && ishuman(A) && A:alternate_appearances && A:alternate_appearances.len) //This whole thing and the stuff below just checks if the atom is a Solid Snake cosplayer. + for(var/datum/alternate_appearance/alt_appearance in user.viewing_alternate_appearances) + if(alt_appearance.owner == A) //If it turns out they are, don't blow their cover. That'd be rude. + atoms.Add(image(alt_appearance.img, A.loc, layer = 4, dir = A.dir)) //Render their disguise. + atoms.Remove(A) //Don't blow their cover. + disguised = 1 + continue + if(!disguised) //If they aren't, treat them normally. + atoms.Add(A) // Sort the atoms into their layers @@ -320,14 +329,10 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s on = 1 /obj/item/device/camera/proc/can_capture_turf(turf/T, mob/user) - var/mob/dummy = new(T) //Go go visibility check dummy var/viewer = user if(user.client) //To make shooting through security cameras possible viewer = user.client.eye - var/can_see = (dummy in viewers(world.view, viewer)) != null - - dummy.loc = null - dummy = null //Alas, nameless creature //garbage collect it instead + var/can_see = (T in view(viewer)) //No x-ray vision cameras. return can_see /obj/item/device/camera/proc/captureimage(atom/target, mob/user, flag) @@ -350,7 +355,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s printpicture(user, P) /obj/item/device/camera/proc/createpicture(atom/target, mob/user, list/turfs, mobs, flag) - var/icon/photoimage = get_icon(turfs, target,user) + var/icon/photoimage = get_icon(turfs, target, user) var/icon/small_img = icon(photoimage) var/icon/tiny_img = icon(photoimage) From 59d7f7114578266731d30e6fcdc85ce73fa7b923 Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Fri, 23 Dec 2016 21:14:50 -0500 Subject: [PATCH 2/2] :eyes: --- code/modules/paperwork/photography.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 05130c57a13..cd53d053dc1 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -235,7 +235,7 @@ var/list/SpookyGhosts = list("ghost","shade","shade2","ghost-narsie","horror","s continue else//not invisable, not a spookyghost add it. var/disguised = null - if(user.viewing_alternate_appearances && user.viewing_alternate_appearances.len && ishuman(A) && A:alternate_appearances && A:alternate_appearances.len) //This whole thing and the stuff below just checks if the atom is a Solid Snake cosplayer. + if(user.viewing_alternate_appearances && user.viewing_alternate_appearances.len && ishuman(A) && A.alternate_appearances && A.alternate_appearances.len) //This whole thing and the stuff below just checks if the atom is a Solid Snake cosplayer. for(var/datum/alternate_appearance/alt_appearance in user.viewing_alternate_appearances) if(alt_appearance.owner == A) //If it turns out they are, don't blow their cover. That'd be rude. atoms.Add(image(alt_appearance.img, A.loc, layer = 4, dir = A.dir)) //Render their disguise.