[IclipMap_t] Store pointers for other structs as well. Should fix other collision related crashes

This commit is contained in:
TheApadayo 2016-12-23 22:38:24 -05:00
parent d075617328
commit fb8f618ddc
2 changed files with 17 additions and 7 deletions

View File

@ -32,9 +32,13 @@ namespace Assets
else else
{ {
buffer->align(Utils::Stream::ALIGN_4); buffer->align(Utils::Stream::ALIGN_4);
builder->storePointer(asset->cPlanes);
buffer->saveArray(asset->cPlanes, asset->numCPlanes); // not sure if this is neede but both brushside and brushedge need it and it can't hurt
for(int i = 0; i < asset->numCPlanes; i++)
{
builder->storePointer(&asset->cPlanes[i]);
buffer->save(&asset->cPlanes[i]);
}
Utils::Stream::ClearPointer(&dest->cPlanes); Utils::Stream::ClearPointer(&dest->cPlanes);
} }
@ -127,7 +131,11 @@ namespace Assets
SaveLogEnter("cBrushEdge"); SaveLogEnter("cBrushEdge");
// no align for char // no align for char
buffer->saveArray(asset->cBrushEdges, asset->numCBrushEdges); for(int i = 0; i < asset->numCBrushEdges; ++i)
{
builder->storePointer(&asset->cBrushEdges[i]); // for reference in cBrush
buffer->save(&asset->cBrushEdges[i]);
}
Utils::Stream::ClearPointer(&dest->cBrushEdges); Utils::Stream::ClearPointer(&dest->cBrushEdges);
SaveLogExit(); SaveLogExit();

View File

@ -1645,6 +1645,8 @@ namespace Components
#ifdef DEBUG #ifdef DEBUG
// Easy dirty disk debugging // Easy dirty disk debugging
Utils::Hook::Set<WORD>(0x4CF7F0, 0xC3CC); Utils::Hook::Set<WORD>(0x4CF7F0, 0xC3CC);
// disable _invoke_watson to allow debugging
Utils::Hook::Set<WORD>(0x6B9602,0xCCCC);
#endif #endif
} }