turf
Enter(atom/movable/e)
var/d = get_dir(src,e) //Get the direction of the object moving onto the turf
if(!ChkDen(e)||!ChkEnter(d))
e.Bump(src) //Added this to call bump, but is there something else I should do?
//Now it calls Bump twice instead of not at all...
return 0
else return ..()
turf
proc
ChkDen(atom/movable/e) //Checks for density and special density
if(src.density) return 0
if(e.pwall&&pwall) return 0
else return 1
ChkEnter(d) //Checks to see if an object can enter
if(d && (dir_to_bitflag[d] & tbit)) return 0 //Directional Blocking
else if(d&(d-1)) return 0 //Block Diag
else return 1
ID:165844
Oct 24 2006, 11:15 am (Edited on Oct 24 2006, 11:28 am)
|
|
I was trying to define my own density variable so that I could have differnt types of density and I got it to work, except that Bump is not called. Is there something else that has to be done?
|
This creates a <code>density2</code> variable. If it's equal or higher, the object is considered dense.
Now that I look at it more closely, you may be wanting to block directions. Here's a version for directions:
I hope I helped ya.