Ok, I've gotten the character to follow the path and when the player's mage comes into c_scan range the AI mage begins attacking. All of that works flawlessly when the mage is approximately 50 pixels above the terrain but when I tried to set the mage on the terrain (using c_trace and hit.z etc) he only walks & animates until he hits the next node on the pathand then gets stuck. Once stuck he changes his pan incredibly quickly (essentially pointing one way then another) but doesn't move forward.

There's more to the code than this but the only pertinent part is (I think)...

Code:
action wizard_patrol()
{
	my.event = wizard_hit;
	my.emask |= ENABLE_IMPACT;   
	
	VECTOR vFeet;
	vec_for_min(vFeet,me);

  ENTITY* enemy = NULL; // spell target

	my.STATE = 1;
	
	result = path_scan(me,my.x,my.pan,vector(360,180,1000));     
	if (result == 0) { return; } 
	var node = 1; // start at first node
	path_getnode(my,node,my.skill20,NULL);
	
	while (1)
	{
		if(my.STATE == 1) 
		{		
		c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
		if (you) // red wizard or flying spell detected?
		    {
			my.STATE = 2; 
			enemy = your.CREATOR;
		    }
		else
		    {
		    VECTOR* temp = NULL;
		    var angle[3];
		    result = vec_to_angle(angle,vec_diff(temp,my.skill20,my.x));
		    if (result < 25) 
		        {
		        node = path_nextnode(my,node,1);
	                path_getnode(my,node,my.skill20,NULL);
		        }
		    my.pan = angle[0];
		    c_move(me,vector(3*time_step,0,0),NULL,GLIDE);
		    my.ANIMATION += 5*time_step;
		    ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);	
		    c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME | IGNORE_PASSABLE);
		    my.z = hit.z - vFeet.z;
	            }
                }



So I believe the problem is w/my c_trace. I adjusted the script to use this same exact code but place the wizard 50 pixels above the terrain and it works fine there so I believe my collisions are off for some reason.