ID:154810
 
So lets say the player is placing something on the map, how would i check to make sure the turf they are trying to occupy is currently not occupied by another object?

I guess the simplest way to explain what i mean is :


Lets say Building A - is currently set on Turf A.

Player A wants to build Building B on Turf B, but accidentally clicks Turf A - how would I go about preventing that object from being placed on Turf A, thus replacing Building A?
for(var/atom/A in turf.contents)
return


This checks for any atom in turf's contents, and if it finds one, returns null, ending the proc before anything is placed.

You want to replace turf with whatever the target would be.
In response to Robertbanks2
If you're just searching for the existence of an object, you can use the locate() proc instead.

if(locate(/atom/movable) in turf)
...