mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-26 10:03:45 +00:00
@@ -1,13 +1,20 @@
|
||||
/mob/living/silicon/robot/proc/photosync()
|
||||
var/obj/item/device/camera/siliconcam/master_cam = connected_ai ? connected_ai.aiCamera : null
|
||||
if (!master_cam)
|
||||
return
|
||||
|
||||
var/synced
|
||||
synced = 0
|
||||
for(var/datum/picture/z in aiCamera.aipictures)
|
||||
if (!(master_cam.aipictures.Find(z)))
|
||||
aiCamera.printpicture(null, z)
|
||||
synced = 1
|
||||
if(synced)
|
||||
src << "<span class='notice'>Locally saved images synced with AI. Images were retained in local database in case of loss of connection with the AI.</span>"
|
||||
/mob/living/silicon/robot/proc/photosync()
|
||||
var/obj/item/device/camera/siliconcam/master_cam = connected_ai ? connected_ai.aiCamera : null
|
||||
if (!master_cam)
|
||||
return
|
||||
|
||||
var/synced = 0
|
||||
// Sync borg images to the master AI.
|
||||
// We don't care about syncing the other way around
|
||||
for(var/obj/item/weapon/photo/borg_photo in aiCamera.aipictures)
|
||||
var/copied = 0
|
||||
for(var/obj/item/weapon/photo/ai_photo in master_cam.aipictures)
|
||||
if(borg_photo.id == ai_photo.id)
|
||||
copied = 1
|
||||
break
|
||||
if(!copied)
|
||||
master_cam.injectaialbum(borg_photo.copy(1), " (synced from [name])")
|
||||
synced = 1
|
||||
|
||||
if(synced)
|
||||
src << "<span class='notice'>Images synced with AI. Local images will be retained in the case of loss of connection with the AI.</span>"
|
||||
|
||||
@@ -159,9 +159,8 @@ var/list/robot_verbs_default = list(
|
||||
connected_ai = select_active_ai_with_fewest_borgs()
|
||||
if(connected_ai)
|
||||
connected_ai.connected_robots += src
|
||||
lawsync()
|
||||
photosync()
|
||||
lawupdate = 1
|
||||
sync()
|
||||
else
|
||||
lawupdate = 0
|
||||
|
||||
@@ -178,6 +177,10 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
|
||||
|
||||
/mob/living/silicon/robot/proc/sync()
|
||||
if(lawupdate && connected_ai)
|
||||
lawsync()
|
||||
photosync()
|
||||
|
||||
/mob/living/silicon/robot/drain_power(var/drain_check)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user