Fixes AI eyes getting nullspaced when jumping to deleted cameras (#33856)
This commit is contained in:
@@ -57,19 +57,17 @@
|
||||
toggle_cam()
|
||||
|
||||
/obj/machinery/camera/Destroy()
|
||||
toggle_cam(null, 0) //kick anyone viewing out
|
||||
if(can_use())
|
||||
toggle_cam(null, 0) //kick anyone viewing out and remove from the camera chunks
|
||||
GLOB.cameranet.cameras -= src
|
||||
if(isarea(myarea))
|
||||
LAZYREMOVE(myarea.cameras, src)
|
||||
if(assembly)
|
||||
qdel(assembly)
|
||||
assembly = null
|
||||
QDEL_NULL(assembly)
|
||||
if(bug)
|
||||
bug.bugged_cameras -= src.c_tag
|
||||
if(bug.current == src)
|
||||
bug.current = null
|
||||
bug = null
|
||||
GLOB.cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that
|
||||
GLOB.cameranet.cameras -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/camera/emp_act(severity)
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
/mob/living/silicon/ai/proc/get_camera_list()
|
||||
|
||||
track.cameras.Cut()
|
||||
|
||||
if(src.stat == DEAD)
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in GLOB.cameranet.cameras)
|
||||
L.Add(C)
|
||||
@@ -18,25 +12,18 @@
|
||||
if (tempnetwork.len)
|
||||
T[text("[][]", C.c_tag, (C.can_use() ? null : " (Deactivated)"))] = C
|
||||
|
||||
track.cameras = T
|
||||
return T
|
||||
|
||||
|
||||
/mob/living/silicon/ai/proc/ai_camera_list(camera)
|
||||
if (!camera)
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = track.cameras[camera]
|
||||
src.eyeobj.setLoc(C)
|
||||
|
||||
return
|
||||
/mob/living/silicon/ai/proc/show_camera_list()
|
||||
var/list/cameras = get_camera_list()
|
||||
var/camera = input(src, "Choose which camera you want to view", "Cameras") as null|anything in cameras
|
||||
switchCamera(cameras[camera])
|
||||
|
||||
/datum/trackable
|
||||
var/list/names = list()
|
||||
var/list/namecounts = list()
|
||||
var/list/humans = list()
|
||||
var/list/others = list()
|
||||
var/list/cameras = list()
|
||||
|
||||
/mob/living/silicon/ai/proc/trackable_mobs()
|
||||
|
||||
@@ -143,13 +130,9 @@
|
||||
/obj/machinery/camera/attack_ai(mob/living/silicon/ai/user)
|
||||
if (!istype(user))
|
||||
return
|
||||
if (!src.can_use())
|
||||
if (!can_use())
|
||||
return
|
||||
user.eyeobj.setLoc(get_turf(src))
|
||||
|
||||
|
||||
/mob/living/silicon/ai/attack_ai(mob/user)
|
||||
ai_camera_list()
|
||||
user.switchCamera(src)
|
||||
|
||||
/proc/camera_sort(list/L)
|
||||
var/obj/machinery/camera/a
|
||||
|
||||
Reference in New Issue
Block a user