#define TILE_WIDTH 32
#define TILE_HEIGHT 32
#define clamp(v,l,h) min(max(v,l),h)
world
New()
wmaxx = world.maxx*TILE_WIDTH
wmaxy = world.maxy*TILE_HEIGHT
var
wmaxx
wmaxy
got_loc
got_sx
got_sy
proc
getLoc(gx,gy,z)
gx = clamp(gx,0,wmaxx); gy = clamp(gy,0,wmaxy)
got_loc = locate(gx/TILE_WIDTH+1,gy/TILE_HEIGHT+1,z)
if(got_loc)
got_sx = gx%TILE_WIDTH
got_sy = gy%TILE_HEIGHT
else
got_sx = 0
got_sy = 0
atom/movable
//causes runtime errors:
Move(global_x,global_y,z,Dir=0)
getLoc(global_x,global_y,z)
return ..(got_loc,Dir,got_sx,got_sy)
/*does not cause runtime errors:
Move(global_x,global_y,z,Dir=0)
getLoc(global_x,global_y,z)
global_x = got_loc
global_y = Dir
z = got_sx
Dir = got_sy
return ..()*/
Expected Results:
Supplying the arguments of a supercall should effectively override the args of the supercalled proc. When the supercall is to an internal function, however, the internal function does not obey this rule.
Notice that this problem does not occur when we change the arguments manually.