Fix camera lag (#3405)

Edge case where the turf you click is the outside station area, and it has to crawl that fucking massive area.

Also makes the loop generally more efficient.
This commit is contained in:
Erki
2017-09-06 23:00:58 +03:00
committed by GitHub
parent ecf1b58aba
commit cbc86ff187
2 changed files with 16 additions and 1 deletions
+11 -1
View File
@@ -142,7 +142,17 @@
jump_to = locate() in A
else if(isturf(A))
var/best_dist = INFINITY
for(var/obj/machinery/camera/camera in get_area(A))
var/check_area = get_area(A)
if (!check_area)
return
for(var/cc in SSmachinery.all_cameras)
var/obj/machinery/camera/camera = cc
if(!camera.loc)
continue
if (camera.loc.loc != check_area)
continue
if(!camera.can_use())
continue
if(!can_access_camera(camera))
@@ -0,0 +1,5 @@
author: Skull132
delete-after: true
changes:
- bugfix: "Cameras will no longer lag the server to death whenever you click to jump to a turf that's outside the station."