Say you have like 3 path nodes. Pathnode1 2 and 3 the only thing you gotta do is add the pathnodes.
void Function()
{
AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode2", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode3", float afWaitTime, string& asAnimation);
}
And then you just add the pathnode1 again.
void AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
So it will look like this:
void Function()
{
AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode2", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode3", float afWaitTime, string& asAnimation);
AddEnemyPatrolNode("Monster", "Pathnode1", float afWaitTime, string& asAnimation);
}
Then when it reaches the pathnode1 it will repeat the action by going to number 2 then 3 and then continue patrolling