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

@@ -103,7 +103,7 @@
usr << "No input found please hang up and try your call again."
return
id = input
for(var/obj/machinery/conveyor_switch/C in world)
for(var/obj/machinery/conveyor_switch/C in machines)
if(C.id == id)
C.conveyors |= src
return
@@ -190,7 +190,7 @@
/obj/machinery/conveyor_switch/LateInitialize()
conveyors = list()
for(var/obj/machinery/conveyor/C in world)
for(var/obj/machinery/conveyor/C in machines)
if(C.id == id)
conveyors += C
@@ -238,7 +238,7 @@
update()
// find any switches with same id as this one, and set their positions to match us
for(var/obj/machinery/conveyor_switch/S in world)
for(var/obj/machinery/conveyor_switch/S in machines)
if(S.id == src.id)
S.position = position
S.update()
@@ -269,7 +269,7 @@
return
id = input
conveyors = list() // Clear list so they aren't double added.
for(var/obj/machinery/conveyor/C in world)
for(var/obj/machinery/conveyor/C in machines)
if(C.id == id)
conveyors += C
return
@@ -289,7 +289,7 @@
update()
// find any switches with same id as this one, and set their positions to match us
for(var/obj/machinery/conveyor_switch/S in world)
for(var/obj/machinery/conveyor_switch/S in machines)
if(S.id == src.id)
S.position = position
S.update()

View File

@@ -130,7 +130,7 @@
for (var/mob/C in viewers(src))
C.show_message("<font color='red'>[GM.name] has been placed in the [src] by [user].</font>", 3)
qdel(G)
add_attack_logs(user,GM,"Disposals dunked")
return
@@ -967,7 +967,7 @@
// *** TEST verb
//client/verb/dispstop()
// for(var/obj/structure/disposalholder/H in world)
// for(var/obj/structure/disposalholder/H in all_objs)
// H.active = 0
// a straight or bent segment