diff --git a/code/WorkInProgress/AI_Visibility.dm b/code/WorkInProgress/AI_Visibility.dm index 00e090c221e..a18da5b5f43 100644 --- a/code/WorkInProgress/AI_Visibility.dm +++ b/code/WorkInProgress/AI_Visibility.dm @@ -301,6 +301,7 @@ var/datum/cameranet/cameranet = new() // machine = null if(!eyeobj) //if it got deleted somehow (like an admin trying to fix things <.<') eyeobj = new() + eyeobj.ai = src client.eye = eyeobj eyeobj.loc = loc cameranet.visibility(eyeobj) @@ -405,5 +406,20 @@ var/datum/cameranet/cameranet = new() set category = "OOC" reset_view(null) machine = null - del eyeobj - src.freelook() + +/mob/living/silicon/ai/reset_view(atom/A) + if (client) + if(!eyeobj) + eyeobj = new() + eyeobj.ai = src + + client.eye = eyeobj + client.perspective = EYE_PERSPECTIVE + + if (istype(A, /atom/movable)) + eyeobj.loc = locate(A.x, A.y, A.z) + + else + eyeobj.loc = locate(src.x, src.y, src.z) + + cameranet.visibility(eyeobj) \ No newline at end of file diff --git a/code/game/machinery/camera.dm b/code/game/machinery/camera.dm index a30f5560bef..a6cf27724a1 100644 --- a/code/game/machinery/camera.dm +++ b/code/game/machinery/camera.dm @@ -98,19 +98,15 @@ usr:cameraFollow = target usr << "Now tracking target on camera." //Unidentifieds are no longer screamed at you. - if (usr.machine == null) + + if (usr.machine == null && client.eye != eyeobj) usr.machine = usr spawn (0) - if(client.eye == eyeobj) - if(checkcameravis(target)) - eyeobj.loc = target.loc - else - usr << "Target is not on or near any active cameras on the station." - return while (usr:cameraFollow == target) if (usr:cameraFollow == null) return + else if (istype(target, /mob/living/carbon/human)) if(istype(target:wear_id, /obj/item/weapon/card/id/syndicate)) usr << "Follow camera mode terminated." @@ -134,6 +130,17 @@ sleep(40) //because we're sleeping another second after this (a few lines down) continue + else if(client.eye == eyeobj) + if(checkcameravis(target)) + eyeobj.loc = target.loc + sleep(50) + continue + + else + usr << "Target is not on or near any active cameras on the station." + usr:cameraFollow = null + return + var/obj/machinery/camera/C = usr:current if ((C && istype(C, /obj/machinery/camera)) || C==null) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 17bad9ef72d..a59fdb7d13d 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -579,7 +579,9 @@ if(C.network == newnet) cameralist.Add(C) - switchCamera( pick(cameralist) ) + if(length(cameralist)) + switchCamera( pick(cameralist) ) + src << "\blue Jumped to [newnet] camera network." //End of code by Mord_Sith //cael - with the multiple onstation networks all linked together, changing networks is legacy functionality