ID:175505
 
How would I go about deleting all the obj/ in a turf??

var/obj/O = locate(7,9,1)
if(istype(O))
del(O)

--------------------
I need this code to delete all objects located in that location. Not sure how to proceed.

LordJR wrote:
How would I go about deleting all the obj/ in a turf??

var/obj/O = locate(7,9,1)
if(istype(O))
del(O)

--------------------
I need this code to delete all objects located in that location. Not sure how to proceed.

When you use locate like that, it returns the turf at that location.

Istype() requires more than one arguement. It needs the atom to check, and the type to check to see if it is. (if(istype(src,/mob)))

All you would have to do, is define a turf using locate(), then loop through all of the objects containted in it's contents, then delete them.
var/turf/CheckTurf=locate(7,9,1)
for(var/obj/TargetObj in CheckTurf.contents) del(TargetObj)


~>Volte
In response to Volte
Thanks Volte.. I still have the simple stuff to remember as well.. ;) But I'm making progress...