ID:165479
 
I have a nondense projectile and i want to check for mobs in the turf that the projectile is in and the turf that is right behind it. What would be the best way to go about this.
Well, to do stuff if mobs are in an atom (or turf, of course), use a for(var/mob/M in T) list loop to loop threw it's contents var. To only check if there is [at least 1] mob in the atom, use locate(/mob) in A, A being the atom (turf). That locate() call will return a reference to one of the mobs in T, if there aren't any, then it will return false.

Though I can't see why you will want to go threw this hassle for a projectile; just make it dense and use Bump() etc normally.
In response to Kaioken
Well one reason is that Bump() cna lead to some problems later on if there alot of other things besides your basic bump and add damage. Like for me, when a spell bumped a mob, it would call deathcheck multiple times causing multiple EXP gives and respawns. There's alot more going into Bump() for projectiles then dealing damage and calling a Death proc.
In response to Pyro_dragons
Then make sure your Bump() is robust, organized, and overall good and cleaned up. You can still use it. :p
In response to Kaioken
Would using the Block() proc be efficient in this case?
In response to Dice1989
Dice1989 wrote:
Would using the Block() proc be efficient in this case?

Well, I can't be entirely sure what you refer to by this case. But the block() proc can be useful to give a list of all turfs in a cube, then easily doing proccessing on those turfs by looping threw the returned list.