Clipmove
from BUILDINF.txt: clipmove(long *x, long *y, long *z, short *sectnum, long xvect, long yvect, long walldist, long ceildist, long flordist, unsigned long cliptype)
Moves any object (x, y, z) in any direction at any velocity and will make sure the object will stay a certain distance from walls (walldist)
Pass the pointers of the starting position (x, y, z). Then pass the starting position's sector number as a pointer also.
Also these values will be modified accordingly. Pass the direction and velocity by using a vector (xvect, yvect).
xvect = velocity * cos(angle) yvect = velocity * sin(angle)
Walldist tells how close the object can get to a wall. I use 128L as my default. If you increase walldist all of a sudden for a certain object, the object might leak through a wall, so don't do that!
Cliptype is a mask that tells whether the object should be clipped to or not. The lower 16 bits are anded with wall[].cstat and the higher 16 bits are anded with sprite[].cstat.
Clipmove return values:
0 (touched nothing) 32768+wallnum (wall first touched) 49152+spritenum (sprite first touched)