for(var/mob/M in world)
if(M in oview(5))
del(M)
else if(!(M in oview(5)))
world << "They aren't there?"
Problem description:
So, I've been looking for a solution to a major feature I'd like to use for my game. I'm looking for a code that allows me to search for something on the players screen or in their oview(), but if the desired object isn't there. I want it to perform another action.
Above, I put what I've been testing.
As for the code you posted, you should avoid 'in world' anywhere you can when looping.