Merge pull request #1098 from Uristqwerty/AI-visibility-fixes

Ai visibility fixes
This commit is contained in:
CIB
2012-05-19 01:57:44 -07:00
3 changed files with 36 additions and 16 deletions
+18 -8
View File
@@ -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)
@@ -368,12 +369,6 @@ var/datum/cameranet/cameranet = new()
return 1
return 0
/mob/living/silicon/ai/switchCamera(var/obj/machinery/camera/C)
if(C && isturf(C.loc))
eyeobj.loc = C.loc
cameranet.visibility(eyeobj)
return
/mob/living/silicon/ai/attack_ai(var/mob/user as mob)
if (user != src)
return
@@ -411,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)
+14 -7
View File
@@ -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)
+4 -1
View File
@@ -441,6 +441,7 @@
if(client.eye == eyeobj)
eyeobj.loc = C.loc
cameranet.visibility(eyeobj)
else
machine = src
src:current = C
@@ -578,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