Cego.FollowCharacter

FollowCharacter is a cool and powerful function in AGS. But if you don't disable it, it can lead to freezing your game. If you code a character to change room (Cnpc.ChangeRoom(x)) while following another character (specially in Rep_Execute) it'll most likely loop the game continuously.

The way to stop a character to follow another is simple:

Cnpc.FollowCharacter(null);