mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Removes the global lists all_clothing, all_items, all_objs, and all_atoms for performance reasons.
- The cost of maintaining these lists is more than the benefit of having them (mostly used only for debugging code)
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
GLOBAL_LIST_BOILERPLATE(all_atoms, /atom) // Use with care, its likely barely better than using world.
|
|
||||||
|
|
||||||
/atom
|
/atom
|
||||||
layer = TURF_LAYER //This was here when I got here. Why though?
|
layer = TURF_LAYER //This was here when I got here. Why though?
|
||||||
var/level = 2
|
var/level = 2
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/datum/file/program/crew/proc/scan()
|
/datum/file/program/crew/proc/scan()
|
||||||
for(var/obj/item/clothing/under/C in all_clothing)
|
for(var/obj/item/clothing/under/C in world)
|
||||||
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
|
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))
|
||||||
tracked |= C
|
tracked |= C
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
GLOBAL_LIST_BOILERPLATE(all_items, /obj/item)
|
|
||||||
|
|
||||||
/obj/item
|
/obj/item
|
||||||
name = "item"
|
name = "item"
|
||||||
icon = 'icons/obj/items.dmi'
|
icon = 'icons/obj/items.dmi'
|
||||||
@@ -588,7 +586,7 @@ var/list/global/slot_flags_enumeration = list(
|
|||||||
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant
|
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant
|
||||||
|
|
||||||
//not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made.
|
//not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made.
|
||||||
for(var/obj/item/A in all_items)
|
for(var/obj/item/A in world)
|
||||||
if(A.type == type && !A.blood_overlay)
|
if(A.type == type && !A.blood_overlay)
|
||||||
A.blood_overlay = image(I)
|
A.blood_overlay = image(I)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
GLOBAL_LIST_BOILERPLATE(all_objs, /obj)
|
|
||||||
|
|
||||||
/obj
|
/obj
|
||||||
layer = OBJ_LAYER
|
layer = OBJ_LAYER
|
||||||
plane = OBJ_PLANE
|
plane = OBJ_PLANE
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
if(!.)
|
if(!.)
|
||||||
return
|
return
|
||||||
|
|
||||||
for(var/obj/item/clothing/O in all_clothing)
|
for(var/obj/item/clothing/O in world)
|
||||||
qdel(O)
|
qdel(O)
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
if(!.)
|
if(!.)
|
||||||
return
|
return
|
||||||
|
|
||||||
for(var/obj/item/clothing/under/O in all_clothing)
|
for(var/obj/item/clothing/under/O in world)
|
||||||
qdel(O)
|
qdel(O)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@
|
|||||||
from_objs += m
|
from_objs += m
|
||||||
|
|
||||||
else if(text_starts_with(f, "/obj/item"))
|
else if(text_starts_with(f, "/obj/item"))
|
||||||
for(var/obj/item/m in all_items)
|
for(var/obj/item/m in world)
|
||||||
if(istype(m, f2))
|
if(istype(m, f2))
|
||||||
from_objs += m
|
from_objs += m
|
||||||
|
|
||||||
@@ -125,12 +125,12 @@
|
|||||||
from_objs += m
|
from_objs += m
|
||||||
|
|
||||||
else if(text_starts_with(f, "/obj"))
|
else if(text_starts_with(f, "/obj"))
|
||||||
for(var/obj/m in all_objs)
|
for(var/obj/m in world)
|
||||||
if(istype(m, f2))
|
if(istype(m, f2))
|
||||||
from_objs += m
|
from_objs += m
|
||||||
|
|
||||||
else if(text_starts_with(f, "/atom"))
|
else if(text_starts_with(f, "/atom"))
|
||||||
for(var/atom/m in all_atoms)
|
for(var/atom/m in world)
|
||||||
if(istype(m, f2))
|
if(istype(m, f2))
|
||||||
from_objs += m
|
from_objs += m
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
var/blocked = list(/obj, /mob, /mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/observer/dead, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai)
|
var/blocked = list(/obj, /mob, /mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/observer/dead, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai)
|
||||||
var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in typesof(/obj) + typesof(/mob) - blocked
|
var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in typesof(/obj) + typesof(/mob) - blocked
|
||||||
if(hsbitem)
|
if(hsbitem)
|
||||||
for(var/atom/O in all_atoms)
|
for(var/atom/O in world)
|
||||||
if(istype(O, hsbitem))
|
if(istype(O, hsbitem))
|
||||||
qdel(O)
|
qdel(O)
|
||||||
log_admin("[key_name(src)] has deleted all instances of [hsbitem].")
|
log_admin("[key_name(src)] has deleted all instances of [hsbitem].")
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ var/list/debug_verbs = list (
|
|||||||
|
|
||||||
var/list/atom/atom_list = list()
|
var/list/atom/atom_list = list()
|
||||||
|
|
||||||
for(var/atom/A in all_atoms)
|
for(var/atom/A in world)
|
||||||
if(istype(A,type_path))
|
if(istype(A,type_path))
|
||||||
var/atom/B = A
|
var/atom/B = A
|
||||||
while(!(isturf(B.loc)))
|
while(!(isturf(B.loc)))
|
||||||
@@ -332,7 +332,7 @@ var/list/debug_verbs = list (
|
|||||||
|
|
||||||
var/count = 0
|
var/count = 0
|
||||||
|
|
||||||
for(var/atom/A in all_atoms)
|
for(var/atom/A in world)
|
||||||
if(istype(A,type_path))
|
if(istype(A,type_path))
|
||||||
count++
|
count++
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if ( istype(A , O.type) )
|
if ( istype(A , O.type) )
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if (A.type == O.type)
|
if (A.type == O.type)
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if ( istype(A , O.type) )
|
if ( istype(A , O.type) )
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if (A.type == O.type)
|
if (A.type == O.type)
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if ( istype(A , O.type) )
|
if ( istype(A , O.type) )
|
||||||
if(variable=="light_range")
|
if(variable=="light_range")
|
||||||
A.set_light(new_value)
|
A.set_light(new_value)
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if (A.type == O.type)
|
if (A.type == O.type)
|
||||||
if(variable=="light_range")
|
if(variable=="light_range")
|
||||||
A.set_light(new_value)
|
A.set_light(new_value)
|
||||||
@@ -275,7 +275,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if ( istype(A , O.type) )
|
if ( istype(A , O.type) )
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if (A.type == O.type)
|
if (A.type == O.type)
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O.type, /obj))
|
else if(istype(O.type, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if ( istype(A , O.type) )
|
if ( istype(A , O.type) )
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O.type, /obj))
|
else if(istype(O.type, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if (A.type == O.type)
|
if (A.type == O.type)
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if ( istype(A , O.type) )
|
if ( istype(A , O.type) )
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
@@ -362,7 +362,7 @@
|
|||||||
M.vars[variable] = O.vars[variable]
|
M.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
else if(istype(O, /obj))
|
else if(istype(O, /obj))
|
||||||
for(var/obj/A in all_objs)
|
for(var/obj/A in world)
|
||||||
if (A.type == O.type)
|
if (A.type == O.type)
|
||||||
A.vars[variable] = O.vars[variable]
|
A.vars[variable] = O.vars[variable]
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@
|
|||||||
switch(action_type)
|
switch(action_type)
|
||||||
if("Strict type")
|
if("Strict type")
|
||||||
var/i = 0
|
var/i = 0
|
||||||
for(var/obj/Obj in all_objs)
|
for(var/obj/Obj in world)
|
||||||
if(Obj.type == O_type)
|
if(Obj.type == O_type)
|
||||||
i++
|
i++
|
||||||
qdel(Obj)
|
qdel(Obj)
|
||||||
@@ -195,7 +195,7 @@
|
|||||||
message_admins("<span class='notice'>[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted)</span>")
|
message_admins("<span class='notice'>[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted)</span>")
|
||||||
if("Type and subtypes")
|
if("Type and subtypes")
|
||||||
var/i = 0
|
var/i = 0
|
||||||
for(var/obj/Obj in all_objs)
|
for(var/obj/Obj in world)
|
||||||
if(istype(Obj,O_type))
|
if(istype(Obj,O_type))
|
||||||
i++
|
i++
|
||||||
qdel(Obj)
|
qdel(Obj)
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
GLOBAL_LIST_BOILERPLATE(all_clothing, /obj/item/clothing)
|
|
||||||
|
|
||||||
/obj/item/clothing
|
/obj/item/clothing
|
||||||
name = "clothing"
|
name = "clothing"
|
||||||
siemens_coefficient = 0.9
|
siemens_coefficient = 0.9
|
||||||
|
|||||||
@@ -967,7 +967,7 @@
|
|||||||
|
|
||||||
// *** TEST verb
|
// *** TEST verb
|
||||||
//client/verb/dispstop()
|
//client/verb/dispstop()
|
||||||
// for(var/obj/structure/disposalholder/H in all_objs)
|
// for(var/obj/structure/disposalholder/H in world)
|
||||||
// H.active = 0
|
// H.active = 0
|
||||||
|
|
||||||
// a straight or bent segment
|
// a straight or bent segment
|
||||||
|
|||||||
Reference in New Issue
Block a user