for(var/bad_code in world)

Removes a very large amount of world loops.
Adds a macro to painlessly generate a global list, and the needed code to modify the list when an object is made or deleted automatically.
Cleans up some commented out code.
This commit is contained in:
Neerti
2018-04-29 17:55:04 -04:00
parent 81c19c62a3
commit be73b8c36a
103 changed files with 274 additions and 403 deletions

View File

@@ -57,7 +57,7 @@
proc/scan()
for(var/obj/item/clothing/under/C in world)
for(var/obj/item/clothing/under/C in all_clothing)
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
tracked |= C
return 1

View File

@@ -128,7 +128,7 @@
dat += "<a href='?src=\ref[src];screen=1'>Back</a>"
dat += "<br><b>Medical Robots:</b>"
var/bdat = null
for(var/mob/living/bot/medbot/M in world)
for(var/mob/living/bot/medbot/M in mob_list)
if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M)

View File

@@ -27,7 +27,7 @@
else if(screen == 1)
dat += "<HR>Chemical Implants<BR>"
var/turf/Tr = null
for(var/obj/item/weapon/implant/chem/C in world)
for(var/obj/item/weapon/implant/chem/C in all_chem_implants)
Tr = get_turf(C)
if((Tr) && (Tr.z != computer.z)) continue//Out of range
if(!C.implanted) continue
@@ -37,7 +37,7 @@
dat += "<A href='?src=\ref[src];inject10=\ref[C]'>(<font color=red>(10)</font>)</A><BR>"
dat += "********************************<BR>"
dat += "<HR>Tracking Implants<BR>"
for(var/obj/item/weapon/implant/tracking/T in world)
for(var/obj/item/weapon/implant/tracking/T in all_tracking_implants)
Tr = get_turf(T)
if((Tr) && (Tr.z != computer.z)) continue//Out of range
if(!T.implanted) continue