I have 2+ Mobs, with the ability to follow eachother. When following, movement is controlled by the leader. The issue I was having was that the initial leader would end up following one of its followers, stopping all along the chain from moving.

To counteract this I passed a quick check
Code:
if(leader != this)
{
    follow();
}
The next issue was when A follows B who follows C who follows A. My check did not cover that.
a->b->c->a

The below code sends "this" as the argument L. It SHOULD check each Mob, see if it has a leader, check if that leader is me and if it isnt me check its leader and so forth.

There are no syntax errors (that my compiler tells me about), so it must be a logic problem.

Hopefully this snippet is quite easy to follow (for at least 1/2 recursions) and any logic problem should be obvious to everyone except me...because that happens some times

Code:
bool Mob::checkLeader(Mob* L)
{
    if(leader != NULL)          //leader exists
    {
        if(leader != L)         //leader is not me
        {
            if(checkLeader(L))  //leaders-leader(recursive, follow line of leaders to the end)
            {
                return true;
            }
            return false;
        }
        return true;
    }
    return false;
};
Thanks for any help in advance and please feel free to suggest any other method you prefer .