ID:146766
 
turf
water
icon='water.dmi'
density=0
Enter(O)
if(istype(O,/mob))
if(O:onwater==1||istype(O,/mob/player/pet/Bird))
O:density=1
return 1
else
if(O:allowwaterwalk==1)
if(O:multisized==1||O:weights=="weights")
return 0
else
O:onwater=1
O:WaterWalk()
return 1
else
return 0
O:density=1


Problem description:
With this code, anything that gets return 1 can walk through anything. This makes people be able to walk over each other, projectiles not bump() correctly, and more. I'd really appreciate it if you could help me figure out where the density stuff is getting messed up in there.

Newbreedofnerd wrote:
> turf
> water
> icon='water.dmi'
> density=0
> Enter(O)
> if(istype(O,/mob))
> if(O:onwater==1||istype(O,/mob/player/pet/Bird))
> O:density=1
> return 1
> else
> if(O:allowwaterwalk==1)
> if(O:multisized==1||O:weights=="weights")
> return 0
> else
> O:onwater=1
> O:WaterWalk()
> return 1
> else
> return 0
> O:density=1
>

Problem description:
With this code, anything that gets return 1 can walk through anything. This makes people be able to walk over each other, projectiles not bump() correctly, and more. I'd really appreciate it if you could help me figure out where the density stuff is getting messed up in there.


Sorry if this isnt what you wanted, but wouldnt it just be easier to change the Bird's density to 0? That would let the bird walk over anything it wants.
In response to Flame Sage
That's just an extra piece. Thanks for pointing that out though. >_> I really need to get those stinking mobs to stay dense on water though. o.o
In response to Newbreedofnerd
ummm u set the mobs density to 1 like this

example:
mob/Creature
Monster
name="Monster";icon='mobs.dmi';icon_state="Monster1";density=1

<font size="1">( Note:I hope that is like what u ment )</font>
In response to ElderKain
No... When they walk on the turf called water that I posted in the original post, they can walk over anything. It's as if there is src.density=0 in there somewhere, but there isn't anywhere in any of the stuff. I wanted to know how to fix it. I figured it had something to do with the return 1 stuff.
You shouldn't be using the : operator: type cast. Also, instead of if(myVar==1) and if(myVar==0) checks, use if(myVar) and if(!myVar), respectively. If you don't understand either of those pieces of advices, then ask me, and I'll explain.


Aside from that, you're problem is that the normal density rules are being ignored. Instead of returning 1 here, return ..().
In response to Wizkidd0123
Ooooo... That's sexily awesome. That ..() part got it working. Thanks a million. ^_^