Added to \client_process.cpp - it's a little smoother, adds the blank row and saves it. The client still shows the pet window momentarily. I would prefer to put <memset(&m_petinfo, 0, sizeof(struct PetInfo));> in the DeletePetInfo part and then run w/e queries are needed to fill in the blanks allowing the removal of <database.SavePetInfo(this);> below.
I would prefer this whole process done a little earlier. Just a guess but, somewhere near <case ServerOP_SyncWorldTime:> (\zone\worldserver.cpp(744).
This also leaves out what Uleat said before about memory loss? which I have no clue about.
\client_process.cpp(841)
Code:
// added 9/30/15 no rent check (this may need fixing when introducing suspended minion - if this was an issue the queries below should fix it)
if (!RuleB(Pets, PetLogPersistence))
{
SetPet(0);
database.DeletePetInfo(this);
memset(&m_petinfo, 0, sizeof(struct PetInfo));
database.SavePetInfo(this);
}
}