That's because DM's compiler actually includes the argument initialization in the BODY of the function.
mob
var
some_value = 2.5
proc
SomeProc(Somearg=some_value||2.5)
//Somearg will be either the value of some_value, or 2.5 if some_value is 0 or null.
mob
var
some_value = 0
proc
SomeProc(Somearg=(some_value ? 1 : 0))
//Somearg will be 1 or 0 no matter what some_value is set to.
And it gets crazier:
proc
getMoveDir(atom/a,atom/b)
if(isturf(a)&&isturf(b))
if(a.z==b.z)
var/dx = abs(a.x-b.x), dy = abs(a.y-b.y)
if(dx&&dy&&dx<=1&&dy<=1)
return get_dir(a,b)
return 0
move_event
var
atom/movable/mover
atom/OldLoc
atom/NewLoc
Dir
time
atom
movable
Move(atom/NewLoc,Dir=0,MoveEvent=new/move_event(src,loc,NewLoc,Dir,world.time,getMoveDir(loc,NewLoc)))
Is this documented anywhere?
http://www.byond.com/forum/?post=73469#comment3923208