ID:926697
 
Code:
    Bump(turf/building/door/T)
if(istype(T,/turf/building/door))
T.density = 0
T.icon_state = T.open_state
sleep 10
T.density = 1
T.icon_state = T.closed_state
Bump(mob/M)
if(istype(M,/mob))
if(M.aliance != src.aliance)
if(M.speed > src.speed)
M.combat(M,src)
if(src)
src.combat(src,M)
else if(src.speed >= M.speed)
src.combat(src,M)
if(M)
M.combat(M,src)


Problem description:
This code is supposed to do 2 things, 1 is to open doors when you bump into them and the other is to attack enemies when you bump into them. all it does though is attack enemies and not open doors I'm wondering how to fix this
thanks for your help
The latter override covers up the former unless you call ..().
I have never understood that code, how does it work and were would I put it?
..() calls the parent proc, which is useful when you're overriding a proc.

doing..

Bump()
// stuff


Is over riding Bump()'s default behavior (which is nothing, I believe, but this isn't the case at all for most procs.)

calling ..() is the same as calling the default behavior.

If you define that same proc more than once it gets especially important.

Bump()
// do stuff
..()

Bump()
// do more stuff somewhere else
..()


http://www.byond.com/docs/ref/info.html#/proc/@dt;@dt;
For some reason that link doesn't work..
http://www.byond.com/docs/ref/index.html
proc > ..
I've thought this:

Bump() procs doesn't work for turfs!

Try Enter()

That shall work for turf. Simple, really!

but, I guess I was wrong! :X
In response to Audio freak XD
Bump() is called whenever you fail to enter anything.
In response to Kitsueki