Merge pull request #11830 from Aranclanos/updatetriggerthis

Removes update_triggers.dm
This commit is contained in:
phil235
2015-09-19 16:47:19 +02:00
10 changed files with 50 additions and 112 deletions
@@ -1,99 +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_freelook_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)
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(mob/user, choice = 1)
..(user, choice)
if(src.can_use())
cameranet.addCamera(src)
else
src.SetLuminosity(0)
cameranet.removeCamera(src)
/obj/machinery/camera/New()
..()
cameranet.cameras += src
cameranet.addCamera(src)
/obj/machinery/camera/Destroy()
cameranet.cameras -= src
cameranet.removeCamera(src)
return ..()
#undef BORG_CAMERA_BUFFER
+13 -1
View File
@@ -67,6 +67,8 @@
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
/mob/living/silicon/robot/New(loc)
spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
@@ -882,9 +884,18 @@
/mob/living/silicon/robot/proc/radio_menu()
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
#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
@@ -924,6 +935,7 @@
loc.attackby(module_state_2,src)
else if(istype(module_state_3,/obj/item/weapon/storage/bag/ore))
loc.attackby(module_state_3,src)
#undef BORG_CAMERA_BUFFER
/mob/living/silicon/robot/proc/self_destruct()
if(emagged)