ID:2166104
 
(See the best response by Nadrew.)
How do I get rid of this runtime without setting to background or loop checks?

Infinite loop suspected--switching proc to background.
If it is not an infinite loop, either do 'set background=1' or set world.loop_checks=0.
proc name: New (/turf/warp/EpicWarp/New)
source file: interiors.dm,22
usr: null
src: EpicWarp (690,20,1) (/turf/warp/EpicWarp)
call stack:

New()
..()
var/match = 0
for(var/turf/warp/EpicWarp/P in world)
if(P.WINDEX==src.WINDEX && P!=src)// line 22
Wx=P.x
Wy=P.y
Wz=P.z
match = 1
break
if(!match)
world.log << "EpicWarp failed: ([x], [y], [z]): No match for WINDEX=[WINDEX]"
You'd want to add a delay to the loop, or decrease the amount of stuff there is for it to loop over.

If there's a lot of these warps on the map you're going to be eating a ton of resources up because you're calling a giant loop when each one is created.
In response to Nadrew
These are basically portals for doors into a buildings interior. These are created when the world is created and matched with their corresponding warp. I'm guessing there's around a hundred of these so I'll add a delay thanks.
You can probably avoid the loop entirely by using the tag variable, set the tag to something unique for each side and use locate(). Or store them in a list and loop over that list instead of world.
Thanks for the info guys. I guess i'll set up tags but there are like "a million" different warps.
Entered(atom/movable/O)
O.loc = locate(Wx, Wy, Wz)
Best response
You could set the tag as something like:

New()
..()
tag = "Warp_[WINDEX]"


Then access it from the origin:

var/turf/warp/EpicWarp/found = locate("Warp_[WINDEX]") in world-src
if(found)
player.loc = found
// Yadda yadda


You use the -src bit so it excludes the turf from the world lookup, so you can have two things with identical tags without them conflicting. But ideally you'd have something in place so they're all unique because identical tags on anything can get touchy when using locate().
To add onto Nadrews comment, you can store the warps in a global list to access so you're not searching the entire world each time.
In response to Kozuma3
But you would still have to search through the world in order to add them to a global list right? I think I already set up a global list for these warps surprisingly.Thanks for all oft he advice guys.
No, you just add src to the list of warps in the warp's New().