in client_process.cpp at line 542 Below DoStaminaUpdate();
	Code:
	                        Mob* myPet = this->GetPet();
			bool amClient = IsClient();
			if(this->HasPet() && IsClient())
				if(myPet->IsCharmed() && invisible == true && amClient) {    //Null:  charm fades on Invisibility
				myPet->BuffFadeByEffect(SE_Charm);
				myPet->AddToHateList(this, 100);
			}
			if(myPet && invisible == true && amClient)    //Null:  pet goes away on Invisibility
				this->SetPet(0);
 
Namely it's the 
if(myPet && invisible == true && amClient)    //Null:  pet goes away on Invisibility
this->SetPet(0);
lines. I didn't test this. I just noticed it while I was doing an old revision to newest that it had this code.