ID:2173374
 
Can someone please help me out with tags. Things like this have been so discouraging.
mob/proc/
Warp_Mob(turf/warp/EpicWarp/warp)
if(src)
if(warp.interior)
var/turf/warp/found=locate("Exterior_[warp.WINDEX]")
if(found)loc=found
if(!warp.interior)
var/turf/warp/found=locate("Interior_[warp.WINDEX]")
if(found)loc=found


turf/warp
EpicWarp
var
WINDEX=""

New()
..()
if(z==1)
tag="Interior_[WINDEX]"
interior=1
else tag="Exterior_[WINDEX]"

Entered(mob/O)
if(istype(O,/mob/human/player))O.Warp_Mob(src)




I'd add some debugging code along each step to find out where it's failing. I'm betting something with the WINDEX variable isn't being set as you'd expect.
In response to Nadrew
It's working fine , for the most part... The problem here though is cpu.
The only CPU bottleneck I can see there is if you have a lot of warps, it'll cause some excessive usage when you start the world, but it should settle down after a moment.

If you're getting high CPU usage outside of that, the problem lies elsewhere, as there's nothing in the code you posted that would lead to high usage.

One thing I do see is that you should probably be returning ..() inside of Entered() to be sure you're not preventing anything from happening in the default order of operations, but that shouldn't make any difference on CPU usage.
In response to Nadrew
Here is what it's looking like
https://gyazo.com/581c18ab94de9b501b0c20177155c5d4
Pretty ridiculous :(
That's the best place to start then, why is it being called so many times? Add debugging output in there somewhere to see what's calling it and when.
In response to Nadrew
I'll do that but i'm pretty sure it's just people running inside buildings. Thanks
One thing to make sure of is that you're not ending up with instances where warping to one causes a recursive loop to happen, setting loc directly should prevent that, but it's possible that in a live environment players move off of the tile and back on quickly or something of that nature.

There's no obvious reason why it should be using an abnormal amount of CPU power from what you've posted though. Without knowing more about how you have things setup it's impossible to really narrow it down.
In response to Nadrew
Alright well this doesn't happen EVERY time but it'll randomly spike for whatever reason so it may be something relating to that. I have loop protection enabled so how do I prevent recursive loops.
Again, adding debugging text to the proc to record when and how it's being called will go a long way to telling you why it's happening, you can record it along with world.cpu to see where spikes are.