Fixes AI camera tracking

Fixes tracking everyone where, not being able to track everyone with
suit sensors maxed, and not seeing all trackables in the tracking list
This commit is contained in:
Krausus
2015-05-20 07:03:01 -04:00
parent a155e9e049
commit 9d5d8f697c
+4 -6
View File
@@ -136,8 +136,8 @@
var/obj/item/clothing/head/hat = H.head
if(hat.blockTracking)
continue
// Now, are they viewable by a camera? (This is last because it's the most intensive check)
if(!near_camera(M))
// Now, are they trackable? (This is last because it's the most intensive check)
if(!trackable(M))
continue
var/name = M.name
@@ -219,19 +219,17 @@
sleep(10)
/proc/near_camera(var/mob/living/M)
if (!isturf(M.loc))
return 0
if(isrobot(M))
var/mob/living/silicon/robot/R = M
if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M))
return 0
else if(!cameranet.checkCameraVis(M))
else if(!isturf(M.loc) || !cameranet.checkCameraVis(M))
return 0
return 1
/proc/trackable(atom/movable/M)
var/turf/T = get_turf(M)
if(T && (T.z in config.contact_levels))
if(T && (T.z in config.contact_levels) && hassensorlevel(M, SUIT_SENSOR_TRACKING))
return 1
return near_camera(M)