script: waypoint does not work after combat

Hi!

I created a c++ creature script for tc2 to make a creature act like hyjal mobs(move along the WPs to some point),but i found 2 problems:

1.Server will crash for some null pointer(at _ptiddata __cdecl _getptd_noexit (void ) in tidtable.c)while these creatures up to 50 or more;

2.Creature will stop moving once entered a combat;

I compared my script with hyjal_trash and debug many times to see whats the problem but I failed,any problem with my Scripts?XD

Script->TeleTo(https://github.com/q725922/mycode/blob/master/my%20tc2%20code#L13))

/emoticons/default_smile.png sorry,wrong link corrected.

anyone got some ideas?