diff --git a/code/LINDA/LINDA_turf_tile.dm b/code/LINDA/LINDA_turf_tile.dm
index 2d2a5b24e54..4594c198dc9 100644
--- a/code/LINDA/LINDA_turf_tile.dm
+++ b/code/LINDA/LINDA_turf_tile.dm
@@ -56,6 +56,7 @@ turf/simulated
turf/simulated/New()
..()
+ visibilityChanged()
if(!blocks_air)
air = new
@@ -67,6 +68,7 @@ turf/simulated/New()
air.temperature = temperature
turf/simulated/Del()
+ visibilityChanged()
if(active_hotspot)
qdel(active_hotspot)
..()
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index d9253e89294..c5b170b8fcc 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -30,6 +30,7 @@
var/emped = 0 //Number of consecutive EMP's on this camera
/obj/machinery/camera/New()
+ ..()
wires = new(src)
assembly = new(src)
@@ -39,13 +40,22 @@
invalidateCameraCache()
+ if(cameranet.cameras_unsorted || !ticker)
+ cameranet.cameras += src
+ 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)
+
/* // Use this to look for cameras that have the same c_tag.
for(var/obj/machinery/camera/C in cameranet.cameras)
var/list/tempnetwork = C.network&src.network
if(C != src && C.c_tag == src.c_tag && tempnetwork.len)
log_to_dd("[src.c_tag] [src.x] [src.y] [src.z] conflicts with [C.c_tag] [C.x] [C.y] [C.z]")
*/
- ..()
/obj/machinery/camera/initialize()
if(z == ZLEVEL_STATION && prob(3) && !start_active)
@@ -65,6 +75,10 @@
qdel(wires)
wires = null
cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that
+ cameranet.cameras -= src
+ var/list/open_networks = difflist(network,restricted_camera_networks)
+ if(open_networks.len)
+ cameranet.removeCamera(src)
return ..()
/obj/machinery/camera/emp_act(severity)
@@ -233,6 +247,11 @@
return
/obj/machinery/camera/proc/deactivate(user as mob, var/choice = 1)
+ if(can_use())
+ cameranet.addCamera(src)
+ else
+ set_light(0)
+ cameranet.removeCamera(src)
if(choice==1)
invalidateCameraCache()
status = !( src.status )
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 48d1b27d9bd..ec3b787b7fe 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -928,7 +928,7 @@ About the new airlock wires panel:
set_opacity(1)
operating = 0
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(safe)
if(locate(/mob/living) in get_turf(src))
open()
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 721b06ec5dd..08d8cab4438 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -46,7 +46,7 @@
bound_height = width * world.icon_size
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
airlocks += src
return
@@ -54,7 +54,7 @@
/obj/machinery/door/Destroy()
density = 0
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
airlocks -= src
return ..()
@@ -223,7 +223,7 @@
set_opacity(0)
operating = 0
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(autoclose && normalspeed)
spawn(150)
@@ -251,7 +251,7 @@
set_opacity(1) //caaaaarn!
operating = 0
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
return
/obj/machinery/door/proc/crush()
@@ -293,6 +293,12 @@
bound_width = world.icon_size
bound_height = width * world.icon_size
+/obj/machinery/door/proc/update_freelook_sight()
+ // Glass door glass = 1
+ // don't check then?
+ if(!glass && cameranet)
+ cameranet.updateVisibility(src, 0)
+
/obj/machinery/door/BlockSuperconductivity()
if(opacity || heat_proof)
return 1
diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm
index b14fd005674..7f1c8951794 100644
--- a/code/game/machinery/doors/poddoor.dm
+++ b/code/game/machinery/doors/poddoor.dm
@@ -84,7 +84,7 @@
src.density = 0
sleep(5)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -101,7 +101,7 @@
src.icon_state = "pdoor1"
src.set_opacity(initial(opacity))
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(5)
crush()
src.density = 1
@@ -130,7 +130,7 @@
f2.set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -155,7 +155,7 @@
if (src.visible)
src.set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
@@ -182,7 +182,7 @@
f3.set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -209,7 +209,7 @@
if (src.visible)
src.set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
@@ -238,7 +238,7 @@
f4.set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -267,7 +267,7 @@
if (src.visible)
src.set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
@@ -294,7 +294,7 @@
f2.set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -319,7 +319,7 @@
if (src.visible)
src.set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
@@ -346,7 +346,7 @@
f3.set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -373,7 +373,7 @@
if (src.visible)
src.set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
@@ -402,7 +402,7 @@
f4.set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -431,7 +431,7 @@
if (src.visible)
src.set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm
index d140ce42888..5375e9fe084 100644
--- a/code/game/machinery/doors/shutters.dm
+++ b/code/game/machinery/doors/shutters.dm
@@ -42,7 +42,7 @@
density = 0
set_opacity(0)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
operating = 0
@@ -61,7 +61,7 @@
if(visible)
set_opacity(1)
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
operating = 0
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 88000858646..0c53fd9bcca 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -123,7 +123,7 @@
src.density = 0
// src.sd_set_opacity(0) //TODO: why is this here? Opaque windoors? ~Carn
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
if(operating == 1) //emag again
src.operating = 0
@@ -147,7 +147,7 @@
// if(src.visible)
// set_opacity(1) //TODO: why is this here? Opaque windoors? ~Carn
air_update_turf(1)
- update_freelok_sight()
+ update_freelook_sight()
sleep(10)
src.operating = 0
diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm
index 17509ed951e..b123c0f094b 100644
--- a/code/game/objects/effects/effect_system.dm
+++ b/code/game/objects/effects/effect_system.dm
@@ -12,6 +12,16 @@ would spawn and follow the beaker, even if it is carried or thrown.
mouse_opacity = 0
unacidable = 1//So effect are not targeted by alien acid.
+/obj/effect/effect/New()
+ ..()
+ if(ticker)
+ cameranet.updateVisibility(src)
+
+/obj/effect/effect/Destroy()
+ if(ticker)
+ cameranet.updateVisibility(src)
+ return ..()
+
/datum/effect/effect/proc/fadeOut(var/atom/A, var/frames = 16)
if(A.alpha == 0) //Handle already transparent case
return
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index bdf8a85286c..a823a880866 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -31,6 +31,13 @@
..()
if(climbable)
verbs += /obj/structure/proc/climb_on
+ if(ticker)
+ cameranet.updateVisibility(src)
+
+/obj/structure/Destroy()
+ if(ticker)
+ cameranet.updateVisibility(src)
+ return ..()
/obj/structure/proc/climb_on()
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 6b4a9e8be94..0ad197e085e 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -33,6 +33,8 @@
flags = 0
+ var/image/obscured //camerachunks
+
/turf/New()
..()
for(var/atom/movable/AM in src)
@@ -359,6 +361,10 @@
ChangeTurf(/turf/space)
return(2)
+/turf/proc/visibilityChanged()
+ if(ticker)
+ cameranet.updateVisibility(src)
+
/turf/proc/get_lumcount() //Gets the lighting level of a given turf.
if(lighting_overlay)
return lighting_overlay.get_clamped_lum()
diff --git a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm
deleted file mode 100644
index 44e358da9d6..00000000000
--- a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm
+++ /dev/null
@@ -1,109 +0,0 @@
-#define BORG_CAMERA_BUFFER 30
-
-//UPDATE TRIGGERS, when the chunk (and the surrounding chunks) should update.
-
-// TURFS
-
-/turf
- var/image/obscured
-
-/turf/proc/visibilityChanged()
- if(ticker)
- cameranet.updateVisibility(src)
-
-/turf/simulated/Del()
- visibilityChanged()
- ..()
-
-/turf/simulated/New()
- ..()
- visibilityChanged()
-
-
-
-// STRUCTURES
-
-/obj/structure/Destroy()
- if(ticker)
- cameranet.updateVisibility(src)
- return ..()
-
-/obj/structure/New()
- ..()
- if(ticker)
- cameranet.updateVisibility(src)
-
-// EFFECTS
-
-/obj/effect/Destroy()
- if(ticker)
- cameranet.updateVisibility(src)
- return ..()
-
-/obj/effect/New()
- ..()
- if(ticker)
- cameranet.updateVisibility(src)
-
-
-// DOORS
-
-// Simply updates the visibility of the area when it opens/closes/destroyed.
-/obj/machinery/door/proc/update_freelok_sight()
- // Glass door glass = 1
- // don't check then?
- if(!glass && cameranet)
- cameranet.updateVisibility(src, 0)
-
-
-// ROBOT MOVEMENT
-
-// Update the portable camera everytime the Robot moves.
-// This might be laggy, comment it out if there are problems.
-/mob/living/silicon/robot/var/updating = 0
-
-/mob/living/silicon/robot/Move()
- var/oldLoc = src.loc
- . = ..()
- if(.)
- if(src.camera && src.camera.network.len)
- if(!updating)
- updating = 1
- spawn(BORG_CAMERA_BUFFER)
- if(oldLoc != src.loc)
- cameranet.updatePortableCamera(src.camera)
- updating = 0
-
-// CAMERA
-
-// An addition to deactivate which removes/adds the camera from the chunk list based on if it works or not.
-
-/obj/machinery/camera/deactivate(user as mob, var/choice = 1)
- ..(user, choice)
- if(src.can_use())
- cameranet.addCamera(src)
- else
- src.set_light(0)
- cameranet.removeCamera(src)
-
-/obj/machinery/camera/New()
- ..()
- //Camera must be added to global list of all cameras no matter what...
- if(cameranet.cameras_unsorted || !ticker)
- cameranet.cameras += src
- 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)
-
-/obj/machinery/camera/Destroy()
- cameranet.cameras -= src
- var/list/open_networks = difflist(network,restricted_camera_networks)
- if(open_networks.len)
- cameranet.removeCamera(src)
- return ..()
-
-#undef BORG_CAMERA_BUFFER
\ No newline at end of file
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 2f570cdbf6b..2e71b85b668 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -78,6 +78,8 @@ var/list/robot_verbs_default = list(
var/lamp_intensity = 0 //Luminosity of the headlamp. 0 is off. Higher settings than the minimum require power.
var/lamp_recharging = 0 //Flag for if the lamp is on cooldown after being forcibly disabled.
+ var/updating = 0 //portable camera camerachunk update
+
var/jetpackoverlay = 0
var/magpulse = 0
@@ -386,8 +388,8 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/verb/cmd_unequip_module()
set name = "Unequip Module"
set hidden = 1
- uneq_active()
-
+ uneq_active()
+
// this verb lets cyborgs see the stations manifest
/mob/living/silicon/robot/verb/cmd_station_manifest()
set category = "Robot Commands"
@@ -753,7 +755,7 @@ var/list/robot_verbs_default = list(
U.forceMove(src)
else
user << "Upgrade error."
-
+
else
spark_system.start()
return ..()
@@ -1132,10 +1134,18 @@ var/list/robot_verbs_default = list(
update_icons()
+#define BORG_CAMERA_BUFFER 30
/mob/living/silicon/robot/Move(a, b, flag)
-
+ var/oldLoc = src.loc
. = ..()
-
+ if(.)
+ if(src.camera)
+ if(!updating)
+ updating = 1
+ spawn(BORG_CAMERA_BUFFER)
+ if(oldLoc != src.loc)
+ cameranet.updatePortableCamera(src.camera)
+ updating = 0
if(module)
if(module.type == /obj/item/weapon/robot_module/janitor)
var/turf/tile = loc
@@ -1167,8 +1177,9 @@ var/list/robot_verbs_default = list(
cleaned_human.shoes.clean_blood()
cleaned_human.update_inv_shoes(0,0)
cleaned_human.clean_blood()
- cleaned_human << "\red [src] cleans your face!"
+ cleaned_human << "[src] cleans your face!"
return
+#undef BORG_CAMERA_BUFFER
/mob/living/silicon/robot/proc/self_destruct()
if(emagged)
@@ -1281,7 +1292,7 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/deathsquad/init()
laws = new /datum/ai_laws/deathsquad
module = new /obj/item/weapon/robot_module/deathsquad(src)
-
+
aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src)
radio = new /obj/item/device/radio/borg/deathsquad(src)
radio.recalculateChannels()
@@ -1295,7 +1306,7 @@ var/list/robot_verbs_default = list(
var/list/borg_candidates = pollCandidates("Do you want to play as a Nanotrasen Combat borg?", poll_time = 300)
if(borg_candidates.len > 0 && isnull(ckey))
searching_for_ckey = 0
- var/mob/M = pick(borg_candidates)
+ var/mob/M = pick(borg_candidates)
M.mind.transfer_to(src)
M.mind.assigned_role = "MODE"
M.mind.special_role = "Death Commando"
@@ -1304,10 +1315,10 @@ var/list/robot_verbs_default = list(
else
searching_for_ckey = 0
user << "Unable to connect to Central Command. Please wait and try again later."
- return
+ return
else
user << "[src] is already checking for possible borgs."
- return
+ return
/mob/living/silicon/robot/syndicate
icon_state = "syndie_bloodhound"
@@ -1328,7 +1339,7 @@ var/list/robot_verbs_default = list(
..()
cell.maxcharge = 25000
cell.charge = 25000
-
+
/mob/living/silicon/robot/syndicate/init()
laws = new /datum/ai_laws/syndicate_override
module = new /obj/item/weapon/robot_module/syndicate(src)
@@ -1336,13 +1347,13 @@ var/list/robot_verbs_default = list(
aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src)
radio = new /obj/item/device/radio/borg/syndicate(src)
radio.recalculateChannels()
-
+
spawn(5)
if(playstyle_string)
src << playstyle_string
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
-
+
/mob/living/silicon/robot/syndicate/medical
icon_state = "syndi-medi"
designation = "Syndicate Medical"
diff --git a/paradise.dme b/paradise.dme
index 42d4d04cad6..778479de1fb 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -1393,7 +1393,6 @@
#include "code\modules\mob\living\silicon\ai\freelook\chunk.dm"
#include "code\modules\mob\living\silicon\ai\freelook\eye.dm"
#include "code\modules\mob\living\silicon\ai\freelook\read_me.dm"
-#include "code\modules\mob\living\silicon\ai\freelook\update_triggers.dm"
#include "code\modules\mob\living\silicon\decoy\death.dm"
#include "code\modules\mob\living\silicon\decoy\decoy.dm"
#include "code\modules\mob\living\silicon\decoy\life.dm"