Merge pull request #8297 from PsiOmegaDelta/CameraCoverage

Camera coverage fixes.
This commit is contained in:
Chinsky
2015-02-27 13:11:21 +03:00
9 changed files with 46 additions and 46 deletions

View File

@@ -33,7 +33,6 @@
camera = new /obj/machinery/camera(src)
camera.replace_networks(camera_networks)
cameranet.removeCamera(camera)
camera.c_tag = user.name
user << "\blue User scanned as [camera.c_tag]. Camera activated."
return 1

View File

@@ -120,12 +120,14 @@ var/datum/cameranet/cameranet = new()
for(var/y = y1; y <= y2; y += 16)
if(chunkGenerated(x, y, T.z))
var/datum/camerachunk/chunk = getCameraChunk(x, y, T.z)
if(choice == 0)
// Remove the camera.
chunk.cameras -= c
else if(choice == 1)
// You can't have the same camera in the list twice.
chunk.cameras |= c
// Only add actual cameras to the list of cameras
if(istype(c, /obj/machinery/camera))
if(choice == 0)
// Remove the camera.
chunk.cameras -= c
else if(choice == 1)
// You can't have the same camera in the list twice.
chunk.cameras |= c
chunk.hasChanged()
// Will check if a mob is on a viewable turf. Returns 1 if it is, otherwise returns 0.

View File

@@ -64,7 +64,7 @@
else
changed = 1
// The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists.
// The actual updating. It gathers the visible turfs from cameras and puts them into the appropriate lists.
/datum/camerachunk/proc/update()
@@ -76,14 +76,14 @@
var/obj/machinery/camera/c = camera
if(!c)
continue
cameras -= c
if(!c.can_use())
continue
var/turf/point = locate(src.x + 8, src.y + 8, src.z)
if(get_dist(point, c) > 24)
continue
cameras -= c
for(var/turf/t in c.can_see())
newVisibleTurfs[t] = t
@@ -143,14 +143,8 @@
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs[t] = t
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c)
continue
if(!c.can_use())
continue
// At this point we only have functional cameras
for(var/obj/machinery/camera/c in cameras)
for(var/turf/t in c.can_see())
visibleTurfs[t] = t

View File

@@ -84,6 +84,7 @@
/obj/machinery/camera/deactivate(user as mob, var/choice = 1)
..(user, choice)
invalidateCameraCache()
if(src.can_use())
cameranet.addCamera(src)
else
@@ -98,16 +99,11 @@
cameranet.cameras_unsorted = 1
else
dd_insertObjectList(cameranet.cameras, src)
var/list/open_networks = difflist(network,restricted_camera_networks) //...but if all of camera's networks are restricted, it only works for specific camera consoles.
if(open_networks.len) //If there is at least one open network, chunk is available for AI usage.
cameranet.addCamera(src)
update_coverage(1)
/obj/machinery/camera/Del()
cameranet.cameras -= src
var/list/open_networks = difflist(network,restricted_camera_networks)
if(open_networks.len)
cameranet.removeCamera(src)
clear_all_networks()
..()
#undef BORG_CAMERA_BUFFER
#undef BORG_CAMERA_BUFFER

View File

@@ -1143,7 +1143,6 @@ var/list/robot_verbs_default = list(
//Disconnect it's camera so it's not so easily tracked.
if(src.camera)
src.camera.clear_all_networks()
cameranet.removeCamera(src.camera)
/mob/living/silicon/robot/proc/ResetSecurityCodes()