I'm getting this weird crash that only happens when it's enabled. I'm fairly sure it's some sort of stack corruption, but the details of the crash are very strange.
void CMover::UpdateParts(int nSex, int nSkinSet, int nFace, int nHairMesh, int nHeadMesh,
PEQUIP_INFO pEquipInfo, CModelObject* pModel, ItemContainer* pEquipment, BOOL bIfParts,
CMover* pMover)
{
if (pModel == nullptr) // returns false, aka in runtime, the pModel pointer isn't being evaluated to 0
{
MooLog::Write("CMover::UpdateParts : pModel is nullptr");
return;
}
if (bIfParts)
{
// if I uncomment the following line, it won't crash for some reason
//MooLog::Write("CMover::UpdateParts : pModel is %08X", 3);
// Crashes on the following line accessing invalid memory(0x000000C0, which is the offset of m_nPartsIdx)
// It's strange that pModel is evaluating to zero here, considering it was just checked a few lines prior.
pModel->m_nPartsIdx = 0;
}
...
}
Assume singlethreaded app, seeing as no other threads would be writing at the time of this crash. Compiling with VC11 x86.
User contributions licensed under CC BY-SA 3.0