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
+5 -3
View File
@@ -55,18 +55,20 @@
/turf/simulated/New()
..()
levelupdate()
if(smooth)
smooth_icon(src)
visibilityChanged()
if(!blocks_air)
air = new
air.oxygen = oxygen
air.carbon_dioxide = carbon_dioxide
air.nitrogen = nitrogen
air.toxins = toxins
air.temperature = temperature
/turf/simulated/Del()
visibilityChanged()
if(active_hotspot)
active_hotspot.Kill()
..()
+10 -2
View File
@@ -30,16 +30,17 @@
var/emped = 0 //Number of consecutive EMP's on this camera
/obj/machinery/camera/New()
..()
assembly = new(src)
assembly.state = 4
cameranet.cameras += src
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)
world.log << "[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 == 1 && prob(3) && !start_active)
@@ -56,6 +57,8 @@
bug.current = null
bug = 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
cameranet.removeCamera(src)
return ..()
/obj/machinery/camera/emp_act(severity)
@@ -235,6 +238,11 @@
return
/obj/machinery/camera/proc/deactivate(mob/user, displaymessage = 1) //this should be called toggle() but doing a find and replace for this would be ass
if(can_use())
cameranet.addCamera(src)
else
SetLuminosity(0)
cameranet.removeCamera(src)
status = !status
cameranet.updateChunk(x, y, z)
var/change_msg = "deactivates"
+4
View File
@@ -259,6 +259,10 @@
/obj/machinery/door/proc/hasPower()
return !(stat & NOPOWER)
/obj/machinery/door/proc/update_freelook_sight()
if(!glass && cameranet)
cameranet.updateVisibility(src, 0)
/obj/machinery/door/BlockSuperconductivity() // All non-glass airlocks block heat, this is intended.
if(opacity || heat_proof)
return 1
@@ -13,7 +13,14 @@ would spawn and follow the beaker, even if it is carried or thrown.
unacidable = 1//So effect are not targeted by alien acid.
pass_flags = PASSTABLE | PASSGRILLE
/obj/effect/effect/New()
..()
if(ticker)
cameranet.updateVisibility(src)
/obj/effect/effect/Destroy()
if(ticker)
cameranet.updateVisibility(src)
..()
return QDEL_HINT_PUTINPOOL
/*
+4
View File
@@ -8,12 +8,16 @@
smooth_icon(src)
smooth_icon_neighbors(src)
icon_state = ""
if(ticker)
cameranet.updateVisibility(src)
/obj/structure/blob_act()
if(prob(50))
qdel(src)
/obj/structure/Destroy()
if(ticker)
cameranet.updateVisibility(src)
if(opacity)
UpdateAffectingLights()
if(smooth)
+1 -5
View File
@@ -9,11 +9,7 @@
var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed
var/max_fire_temperature_sustained = 0 //The max temperature of the fire which it was subjected to
/turf/simulated/New()
..()
levelupdate()
if(smooth)
smooth_icon(src)
/turf/simulated/proc/burn_tile()
+6 -1
View File
@@ -26,11 +26,13 @@
flags = 0
var/image/obscured //camerachunks
/turf/New()
..()
for(var/atom/movable/AM in src)
Entered(AM)
return
/turf/Destroy()
return QDEL_HINT_HARDDEL_NOW
@@ -281,6 +283,9 @@
/turf/proc/can_lay_cable()
return can_have_cabling() & !intact
/turf/proc/visibilityChanged()
if(ticker)
cameranet.updateVisibility(src)
/turf/indestructible
name = "wall"
@@ -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)
-1
View File
@@ -1218,7 +1218,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\pai\death.dm"
#include "code\modules\mob\living\silicon\pai\examine.dm"
#include "code\modules\mob\living\silicon\pai\life.dm"