mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix 2 crash cases during AIN build
This commit is contained in:
parent
5a2cbaf40a
commit
05b37bf111
@ -91,6 +91,9 @@ void CAI_NetworkBuilder::SaveNetworkGraph(CAI_Network* pNetwork)
|
||||
|
||||
timer.Start();
|
||||
DevMsg(eDLL_T::SERVER, "+- Writing node positions...\n");
|
||||
|
||||
if (pNetwork->m_pAInode)
|
||||
{
|
||||
for (int i = 0; i < pNetwork->m_iNumNodes; i++)
|
||||
{
|
||||
// Construct on-disk node struct.
|
||||
@ -119,6 +122,7 @@ void CAI_NetworkBuilder::SaveNetworkGraph(CAI_Network* pNetwork)
|
||||
|
||||
nCalculatedLinkcount += pNetwork->m_pAInode[i]->m_nNumLinks;
|
||||
}
|
||||
}
|
||||
timer.End();
|
||||
DevMsg(eDLL_T::SERVER, "...done writing node positions. %lf seconds\n", timer.GetDuration().GetSeconds());
|
||||
|
||||
@ -138,6 +142,9 @@ void CAI_NetworkBuilder::SaveNetworkGraph(CAI_Network* pNetwork)
|
||||
}
|
||||
|
||||
writeStream.write(reinterpret_cast<char*>(&nCalculatedLinkcount), sizeof(int));
|
||||
|
||||
if (pNetwork->m_pAInode)
|
||||
{
|
||||
for (int i = 0; i < pNetwork->m_iNumNodes; i++)
|
||||
{
|
||||
for (int j = 0; j < pNetwork->m_pAInode[i]->m_nNumLinks; j++)
|
||||
@ -158,6 +165,7 @@ void CAI_NetworkBuilder::SaveNetworkGraph(CAI_Network* pNetwork)
|
||||
writeStream.write(reinterpret_cast<char*>(&diskLink), sizeof(CAI_NodeLinkDisk));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
timer.End();
|
||||
DevMsg(eDLL_T::SERVER, "...done writing links. %lf seconds (%d links)\n", timer.GetDuration().GetSeconds(), nCalculatedLinkcount);
|
||||
|
Loading…
x
Reference in New Issue
Block a user