Hey guys. I've recently added an enemy in one of my test games and i have been getting a crash.

I have put an enemy on my level in WED, and attached to it a script that make it turn towards the player and move forward, thus moving towards the player. But i keep getting the crash message when the game starts.

This is my code:
Code:
action enemy_action(){
	VECTOR* dir; // this will hold the direction towards the player from the enemy
	while(1){
		vec_diff(dir,player.x,my.x); // set dir towards player
		vec_to_angle(my.pan,dir); // set the enemy's pan towards it
		c_move(me,vector(3 * time_step,0,0),nullvector,GLIDE); // move forward
		wait(1);
	}
}


What am i doing wrong?
BTW : THIS IS LITE-C NOT C-SCRIPT so do not post up C-Sript codes.
Thank you