ID:825416
 
(See the best response by NNAAAAHH.)
Code:
area
Density{density=1}


Problem description:

I have been gone from byond for quite awhile and recently updated to the current version and so on. I noticed that you can no longer use density as an area like above. Is this intended.

Is there a way around this to where i can use a snippet similar to what i have posted to add density to an obj/turf without actually coding it in to the individual obj/turf?
Best response
turf
Enter()
for(var/a in view(0,src))
if(usr.density&&a:density)
return 0
return ..()


Sorry, I just feel this is a situation in which providing a fix is better than providing an explaination on the issue.
Not quite what i am looking for but thank you very much for replying. i am looking to just place an area on top of a turf/obj and have it be dense rather then adding density to every single piece of code involving turf/obj.
In response to Unknown1 (#2)
My fix does that, it's one code you simply have to add into whatever. The reason why I provide a fix rather than a explaination is because I can't quite think of how to explain why it dosn't work, and I couldn't really think of a way to explain it other than telling you directly what to do, in which I might as well do it anyway.
Testing it out now. Thank you again for replying so fast. Will edit post with results.


Edit: Works like a charm buddy thank you very much.
I have no clue why your dense area isn't already blocking. If you have any area/Enter() anywhere that is returning a true value, that would override density.

Anyway, here's a shorter (more proper) version of his code:
turf
Enter(mob/m)
// no usr abuse
// turf.loc is the area containing it
if(m.density && loc.density)
return FALSE
return ..()


Alternatively, this should also work:
area/Density/Enter()  //  leave blank to let it return null

I'm having the same problem with area tiles. I used the code above (long version, the shorter one didn't work) but I find it annoying to use as I can't put anything on top of a dense area block like a bridge over water.

Is there not a simple way to make an area tile dense?
There is. It's been provided. You are just trying to do use a dense area over a non-dense tile, which... Frankly is confusing.