Merge pull request #38644 from AutomaticFrenzy/patch/cameranet

Port AI static to vis_contents
This commit is contained in:
Jordan Brown
2018-06-25 21:22:58 -04:00
committed by letterjay
parent 6b42e20e2a
commit a14bc0615d
8 changed files with 74 additions and 115 deletions
+12 -12
View File
@@ -129,18 +129,18 @@
detect_state = PROXIMITY_ON_SCREEN
break
if(!detect_state && GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z))
var/datum/camerachunk/chunk = GLOB.cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z)
if(chunk)
if(chunk.seenby.len)
for(var/mob/camera/aiEye/A in chunk.seenby)
var/turf/detect_turf = get_turf(A)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
if(get_dist(our_turf, detect_turf) < rangewarning)
detect_state = PROXIMITY_NEAR
break
if(detect_state)
return
var/datum/camerachunk/chunk = GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)
if(chunk && chunk.seenby.len)
for(var/mob/camera/aiEye/A in chunk.seenby)
var/turf/detect_turf = get_turf(A)
if(get_dist(our_turf, detect_turf) < rangealert)
detect_state = PROXIMITY_ON_SCREEN
break
if(get_dist(our_turf, detect_turf) < rangewarning)
detect_state = PROXIMITY_NEAR
break
/obj/item/multitool/cyborg
name = "multitool"
@@ -47,8 +47,9 @@
/turf/open/floor/plating/ashplanet/Initialize()
if(smooth)
pixel_y = -4
pixel_x = -4
var/matrix/M = new
M.Translate(-4, -4)
transform = M
icon = smooth_icon
. = ..()
+3 -2
View File
@@ -27,8 +27,9 @@
/turf/closed/mineral/Initialize()
if (!canSmoothWith)
canSmoothWith = list(/turf/closed/mineral, /turf/closed/indestructible)
pixel_y = -4
pixel_x = -4
var/matrix/M = new
M.Translate(-4, -4)
transform = M
icon = smooth_icon
. = ..()
if (mineralType && mineralAmt && spread && spreadChance)
+11 -2
View File
@@ -19,8 +19,6 @@
flags_1 = CAN_BE_DIRTY_1
var/image/obscured //camerachunks
var/list/image/blueprint_data //for the station blueprints, images of objects eg: pipes
var/explosion_level = 0 //for preventing explosion dodging
@@ -44,6 +42,9 @@
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1
// by default, vis_contents is inherited from the turf that was here before
vis_contents.Cut()
assemble_baseturfs()
levelupdate()
@@ -325,6 +326,14 @@
/turf/proc/visibilityChanged()
GLOB.cameranet.updateVisibility(src)
// The cameranet usually handles this for us, but if we've just been
// recreated we should make sure we have the cameranet vis_contents.
var/datum/camerachunk/C = GLOB.cameranet.chunkGenerated(x, y, z)
if(C)
if(C.obscuredTurfs[src])
vis_contents += GLOB.cameranet.vis_contents
else
vis_contents -= GLOB.cameranet.vis_contents
/turf/proc/burn_tile()