mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
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:
@@ -33,7 +33,7 @@
|
||||
.= res
|
||||
|
||||
/proc/get_area_name(N) //get area by its name
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
if(A.name == N)
|
||||
return A
|
||||
return 0
|
||||
|
||||
@@ -503,9 +503,9 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
moblist.Add(M)
|
||||
for(var/mob/living/simple_animal/M in sortmob)
|
||||
moblist.Add(M)
|
||||
// for(var/mob/living/silicon/hivebot/M in world)
|
||||
// for(var/mob/living/silicon/hivebot/M in sortmob)
|
||||
// mob_list.Add(M)
|
||||
// for(var/mob/living/silicon/hive_mainframe/M in world)
|
||||
// for(var/mob/living/silicon/hive_mainframe/M in sortmob)
|
||||
// mob_list.Add(M)
|
||||
return moblist
|
||||
|
||||
@@ -672,7 +672,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
//Returns: all the areas in the world
|
||||
/proc/return_areas()
|
||||
var/list/area/areas = list()
|
||||
for(var/area/A in world)
|
||||
for(var/area/A in all_areas)
|
||||
areas += A
|
||||
return areas
|
||||
|
||||
@@ -690,7 +690,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/areas = new/list()
|
||||
for(var/area/N in world)
|
||||
for(var/area/N in all_areas)
|
||||
if(istype(N, areatype)) areas += N
|
||||
return areas
|
||||
|
||||
@@ -704,7 +704,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/turfs = new/list()
|
||||
for(var/area/N in world)
|
||||
for(var/area/N in all_areas)
|
||||
if(istype(N, areatype))
|
||||
for(var/turf/T in N) turfs += T
|
||||
return turfs
|
||||
@@ -719,7 +719,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
|
||||
areatype = areatemp.type
|
||||
|
||||
var/list/atoms = new/list()
|
||||
for(var/area/N in world)
|
||||
for(var/area/N in all_areas)
|
||||
if(istype(N, areatype))
|
||||
for(var/atom/A in N)
|
||||
atoms += A
|
||||
|
||||
Reference in New Issue
Block a user