........
mvec[0]=character.movespd*time_step; //movement vector
mvec[1]=character.strafespd*time_step;
c_trace(character.x,vector(character.x,character.y,character.z-1000),IGNORE_ME|IGNORE_SPRITES|SCAN_TEXTURE|IGNORE_PASSABLE|USE_BOX);
mvec[2]=((hit.z - character.min_z)-character.z);
if (hit.entity==NULL)
dist=c_move(character,mvec,nullvector,IGNORE_PASSABLE|GLIDE);
else
{
character.rel_x=character.x-hit.entity.x;
character.rel_y=character.y-hit.entity.y;
wait(1); //let the entity move
mvec_abs[0]=hit.entity.x+character.rel_x-character.x; //this line generates a crash
mvec_abs[1]=hit.entity.y+character.rel_y-character.y;
mvec_abs[2]=0;
dist=c_move(character,mvec,mvec_abs,IGNORE_PASSABLE|GLIDE);
}
........